-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
ui: Restrict the viewing/editing of certain UI elements based on the users ACLs #9687
Conversation
390f2eb
to
3c06c79
Compare
🤔 Double check that this PR does not require a changelog entry in the .changelog directory. Reference |
🤔 Double check that this PR does not require a changelog entry in the .changelog directory. Reference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…9706) * Adds a {{disabled}} modifier that works similar to fieldset In that you can set it to false on a parent node and all its sub nodes will be disabled. It has an added improvement that you can then separate allow children if you want to disable everything apart from one thing. One caveat here is that it relies on dom twiddling and is therefore disabling a parent is not currently very reactive and will need some MutationObserver work to make it fully reactive. * Reorganize the base ability for reuse and add canWrite * Add a session ability * Make the mock-api authorize endpoint less brittle and more configurable * Tweak intention write ability to include IsEditable * Add authzing beforeModel hook to let us to configure auth 403s centrally * Centrally configure abilities for allowing certain endpoints * Add session inspection and allow easy access of can from permissions * Implement read/write access based views across KV/Sessions + Intentions * Show notification depending on item.Session * Lint * Only look at path when auto creating nspaced routes * Conditionally show view or edit words based on permissions * Add new step so we can control permissions from acceptance tests * Add tests to assert permissions inspection functionality * Lint * Add CONSUL_RESOURCE_*_* to README
* WIP * Move authorize to the permissions adapter * Slight cleanup and add Resources everywhere * Show a login on the 403 error page * Change to use authorizeBySlug * Add some words around namespaces and permissions * Add correct namespace support * Reorganize authorizeBy things so we can use a slug or set of perms * Clean up new repo methods, tweak DataLoader to deal with 403's nicer * Service > Node * Add some acceptance tests around single item access * Add configuration 'segmented' so we can mark things that shouldn't request * Default permissions to [] * Fix up adapter test
2d8ca86
to
8623aa8
Compare
🍒 If backport labels were added before merging, cherry-picking will start automatically. To retroactively trigger a backport after merging, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/329527. |
This PR builds on the minimal permission inspection we were using in order to decide whether to show the 'Manage Namespace' menu item for operators.
As we are likely to be doing this kind of thing a lot more often, we've used
ember-can
and followed the approach used by other products using this addon/functionality.The user facing impact of this is that we now only show certain main menu items depending on whether you have read access to them or not. For example, if your ACL token doesn't have read access to KV, then we don't show you the KV navigation link in the main navigation.
We've added a very simple acceptance test only here as there are more upcoming tasks related to this which will probably mean us backing some of the work here with
ember-data
in order to follow the patterns used by the rest of the app, and I felt it would be a good idea to implement another feature related to this first before deciding on whether/how we should do this. Once this is done we'll probably add a little more testing around this also.