-
Notifications
You must be signed in to change notification settings - Fork 874
fix: fix loading states and permissions checks in organization settings #16465
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
When testing the permissions for each Role, how do you know what the permissions should be for each user other than looking at the backend code? Having documentation of the permissions as they relate to all orgs features for all roles will be helpful for reviewing this PR especially any tests, for future testing and for documentation for users For all roles including: |
I don't think it really makes sense to focus on "roles", because custom roles exist. I just focused on "what permissions make sense for enabling x". a "create/new thing" button should only show up for people with the proper permissions to create a that type of thing. |
site/src/pages/OrganizationSettingsPage/CustomRolesPage/CreateEditRolePage.tsx
Outdated
Show resolved
Hide resolved
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
it is correct though, that's how site wide permissions are implemented |
The part that feels incorrect is that a user is only able access an org they are not a member if they have all 3 permissions combined (site wide user admin, template admin and auditor) if they have just 1 or 2 of them then they do not have access. It feels like that should only be for an owner role. Behavior that only happens for combinations of roles feels confusing. |
after looking at the code, the new provisioners page has some deeper rooted permissions issues that probably need to be dealt with separately. |
I think the real issue here is that I gave site auditors |
Why would a site wide template admin or auditor have access to custom roles read only but not idp sync? Whereas a user admin has access to both? I would expect the template admin and auditor does not need even read access to custom roles. |
@jaaydenh this PR is already enormous and fixes a ton of bugs. I appreciate that you want to find more bugs, but this code needs to be merged. this PR is almost two weeks old, if you have a problem with any of the changes I have already made then we can talk about those, but any further fixes need to be follow ups. I'm not gonna keep adding more and more bug fixes in one PR forever. 😅 this is not the right venue to be discussing what permissions a role should have, or to discuss if we describe built-in roles with sufficient detail, the goal here it to make sure that the correct permission is being checked in more places. |
@aslilac Totally fine moving more fixes to another PR. I was imaging the goal of this PR was to correct the frontend permissions for all the built-in site wide and organizations roles. |
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.
Approving this to lock in the all the fixes so far. I will create additional issues for the other bugs that are out of scope.
Closes coder/internal#331
Closes coder/internal#346
Closes coder/internal#347
Closes coder/internal#348
Closes coder/internal#349
Closes coder/internal#350
Closes #16379
Move several organizations permissions queries into one query fetched by the
OrganizationSettingsLayout
componentUpdate permissions checks for whether the organizations settings should be accessible by a user
We used to just check if the user could edit any organization. The problem with that, is that by "organization" we meant the organization table, which just holds metadata, and didn't take into account the ability to edit members, groups, roles, or any other resource. We now check if the user can edit any of these resources individually in any organization.
There are a ton of places where if data was missing we just assumed it was loading. A lot of these have been cleaned up.
Remove the unused
OrganizationSummaryPage
, move the /organizations redirect logic into its own component instead of leaving it in the settings page (which is no longer even the default)More pages are now viewable if the user has permission to view the information on them, even if they can't edit them.