Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix org permissions for org tabs #7242

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

lovincyrus
Copy link
Contributor

@lovincyrus lovincyrus commented Apr 30, 2025

This pull request ensures the correctness of org roles' permissions to the organization tabs. Closes https://github.com/rilldata/rill-private-issues/issues/1651

  • /users can be accessed by org admin + editor
  • /settings can be accessed by org admin

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

* Checks if a user has admin permissions for an organization
*/
export function isOrgAdmin(permissions?: V1OrganizationPermissions): boolean {
return !!permissions?.admin;
Copy link
Contributor Author

@lovincyrus lovincyrus Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious - any reason why we have a separate admin and guest prop but not for editor and viewer? @begelundmuller cc: @ericpgreen2

Copy link
Contributor

@begelundmuller begelundmuller May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I understand it seems a bit weird, but the idea is that admin and guest in this case are flags with a special internal meaning.

You can imagine in the future, we might introduce more roles, like "owner" and "billing admin", which would also have the admin=true despite having different names.

Similarly for guests, there's been discussion about having "guest viewers" and "guest admins" (guests who can invite other guests). They'd both be identified just by guest=true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance that we can have roles editor and viewer in the props? This is so we can have a reliable role source and don't need to maintain a separate org role with the granular permissions for the UI.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe expose role as a separate field that the UI can use and not rely on these flags ?

@lovincyrus lovincyrus self-assigned this Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants