-
Notifications
You must be signed in to change notification settings - Fork 875
feat: add organization-scoped permission checks to deployment settings #14063
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
Conversation
🤖 Meticulous spotted visual differences in 321 of 735 screens tested: view and approve differences detected. Last updated for commit 5a547fc. This comment will update as new commits are pushed. |
ad74fcf
to
f6dfce0
Compare
site/src/pages/ManagementSettingsPage/GroupsPage/GroupsPage.tsx
Outdated
Show resolved
Hide resolved
site/src/pages/ManagementSettingsPage/GroupsPage/GroupsPage.tsx
Outdated
Show resolved
Hide resolved
site/src/pages/ManagementSettingsPage/OrganizationSettingsPage.tsx
Outdated
Show resolved
Hide resolved
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.
I left a few comments, and I see there are a few TODOs in the codebase. Do you plan to finish these TODOs during the current work or address them later? If later, would it make sense to transform the important ones into issues?
PS: I'm going to QA this at some point today.
I QAed the changes and they look good, but I think it could be better if you have specific areas where I should look for issues. Since it is a "draft" PR I'm not approving it for now, but feel free to request another review at any time. |
@BrunoQuaresma Thank you for giving it an early look! I still need to add/update some tests/Storybooks and then I think it will be good to go. I will make some notes on the kinds of things that need to be QA'd. As for the TODOs, I will check with Kira and make issues for the ones she thinks makes sense. |
8a411e3
to
b8bffa5
Compare
All right, I updated the tests and added stories but I had to break out into some views to do that. The code is mostly unchanged but the diff will look a a bit large. So generally here is what I have been testing:
NOTE: The audit log will not work right now for org admins/auditors, but they will once Steven's PR is merged so I will leave this in a draft until that is done then I will mark ready and request a review. <3 |
b8bffa5
to
19f3895
Compare
19f3895
to
584bd19
Compare
Seems like all the other frontend variables use the `view` syntax. Arguably we should use `read` to match the backend, but `view` does seem more UI-like.
All the checks now require both the experiment and license. I also renamed the variable canViewOrganizations everywhere for consistency.
You will only see the button if you can create a group in that org. Now that the old site-wide group permission is unused, remove it.
Since in addition to deployment settings this page now also includes users, audit logs, groups, and orgs. Since you might not be able to fetch deployment values, move all the loaders to the individual pages instead of in the wrapping layout.
We only use this layout when multi-org is enabled, so no need to run the check a second time.
An auditor for example appears to have the view deployment values permission but cannot view licenses.
584bd19
to
185f2c0
Compare
Should be good to go now! |
ccb05b8
to
72bf345
Compare
72bf345
to
d7afcfc
Compare
Thank you for the thorough testing!!
This should be fixed! Looks like you were on an older commit.
|
I changed the automatic redirect for auditors, so now it just says "you have no permissions to edit" if there are no permissions instead of trying to redirect to the audit log. I think we will probably want to consider a better design for this though. I updated the ticket to reflect needing a decision on this. |
1d9ad8a
to
01c4b19
Compare
The 0000 syntax does not work, it has to be the actual org ID. Technically this is probably not necessary since it means only admins can create groups which was already the case, but I think being explicit about the org we are checking is a good idea, even if these pages will eventually go away in favor of the multi-org ones.
I think this needs a proper design/decision.
01c4b19
to
e58b032
Compare
Originally I thought I should update these to use the org-based permissions query but I think maybe I should scope my changes to just the multi-org settings page and leave the old pages alone for now.
I think the "you do not have permission to edit" message might make it sound like you can do nothing at all with the org, but it might be that you can edit members and groups, just not the org settings. So, instead, show the org settings but disable the form if you cannot edit. Probably there is still a better design but maybe this is OK for now.
Just FYI I reverted two changes to the old groups and users pages, I felt like they were out of scope for this PR and I did not directly call them out in the list of stuff to test. I also changed the org settings page to show an ineditable form instead of a big "you cannot edit this org" message but I will get a proper design for this page when a user has no permissions later. |
Part of #13915
You should be able to see the all the links on the settings page to which you have access, and those pages should react appropriately (like groups should only have the create group button if you have permission, etc).
This only affects multi-org. There should be no change if not multi-org.