-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fleet]: Spaces which are not accessible is displayed a "?" under Agent policy settings for custom user having access only for Space2. #193827
Comments
Pinging @elastic/fleet (Team:Fleet) |
@muskangulati-qasource Please review. |
Secondary review on this ticket is Done |
Hey @nchaulet can I check the expectations with you on this one? The reason why the space selector is showing I'm wondering if it wouldn't make more sense to only display spaces available to the user. We could consider adding some information for the user, e.g. an additional sentence in the Spaces input description and/or how many spaces the policy is assigned to that the user hasn't got access to. One thing to note is that the space selector options are fetched independently and don't appear in the dropdown if the user doesn't have access to them. For instance, in the above example, if the policy only had Alternatively, we could still show all the selected spaces and replace the |
@jillguyonnet I think we probably could display a label instead of ? something like:
We should probably also disable that field as the user will not have enough permissions to make space changes and remove it from the API call has otherwise it seems it will not be handled correctly when saving |
Thanks for your feedback @nchaulet - just thinking, could we be in a situation where the user is allowed to add/remove some spaces but not others? For example:
Could this user be allowed to add/remove space1 and space2 but not default? In that case the input would need to remain enabled and it would look like: Otherwise, if they can't make any space changes, it would indeed make sense to disable the input altogether and remove the I can test the above theory tomorrow. |
Could we filter out spaces that the current user can't access entirely rather than displaying a badge? I think it'd be technically considered information leakage here and the badge itself it not informative in anyway. If there are no accessible spaces, disable the input entirely as @jillguyonnet has suggested. |
I think if the user do not have access to all spaces, he should not able to make any spaces change to that policy, so disabling that selector seems the right thing to do. |
My initial suggestion was to hide these, as this is not information relevant to the user. I also thought that showing them would give the false impression that the user can edit them, which is not optimal UX. If we disable the space selector for users that don't have access to all spaces like Nicolas suggested, however, this is not an issue.
I've been doing a bit of testing, details below. The space selector works well for a user with access to all selected spaces, but it is broken otherwise, even if the user tries to add/remove a space they have access to. This is something that may be surprising to the user. For this reason (assuming this behaviour is correct), then it might be better to have some indication of why they can't make edits. One option would be showing the badges of the unavailable spaces (with a suitable label). An alternative would be to hide these badges and add an explanation in the input description. SummaryAssuming that the user should NOT be able to edit the policy spaces if they don't have access to all selected spaces. If the user doesn't have access to all selected spaces:
In addition, one of the following:
|
Another observation I found while investigating: as I mentioned previously, the
However, kibana/x-pack/plugins/fleet/server/services/agent_policy.ts Lines 615 to 618 in 04d04d9
This means there is a difference between In the example above, if the user with access to Default and Foo runs these queries they will see:
This seems like this could be an information leakage concern, WDYT? |
Created #201400 to capture #193827 (comment). |
Kibana Build details:
Role:
space: SPACE2
Preconditions:
Steps to reproduce:
?
.Expected Result:
Spaces which are not accessible should not be displayed even as
?
under Agent policy settings for custom user having access only for Space2.Screen Recording:
Linux.Agent.policy.3.-.Agent.policies.-.Fleet.-.Elastic.-.Google.Chrome.2024-09-24.13-34-25.mp4
Feature:
https://github.com/elastic/ingest-dev/issues/2903
https://github.com/elastic/ingest-dev/issues/1664
The text was updated successfully, but these errors were encountered: