-
-
Notifications
You must be signed in to change notification settings - Fork 821
chore: create Reader project role #11178
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
base: 2-4089
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
API Changelog 7.4.0 vs. 7.4.0GET /api/admin/projects/{projectId}/context
POST /api/admin/projects/{projectId}/context
POST /api/admin/projects/{projectId}/context/validate
DELETE /api/admin/projects/{projectId}/context/{contextField}
GET /api/admin/projects/{projectId}/context/{contextField}
PUT /api/admin/projects/{projectId}/context/{contextField}
POST /api/admin/projects/{projectId}/context/{contextField}/legal-values
DELETE /api/admin/projects/{projectId}/context/{contextField}/legal-values/{legalValue}
GET /api/admin/projects/{projectId}/context/{contextField}/strategies
POST /api/admin/user-admin
PUT /api/admin/user-admin/{id}
|
| VIEWER = 'Viewer', | ||
| OWNER = 'Owner', | ||
| MEMBER = 'Member', | ||
| READER = 'Reader', |
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.
If you relaxed the constraint, can't you use "Viewer"? I'm ok with reader as well, just asking
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.
We can, but it felt like we should use a unique name if possible just to prevent confusion between predefined root and project roles.
| INSERT INTO roles (name, description, type) | ||
| VALUES ('Reader', 'Users with the project reader role have read-only access to the project and cannot make changes.', 'project') | ||
| ON CONFLICT (name, type) DO NOTHING; |
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.
Should the migration fail on conflict? Otherwise, we may end up in an invalid state
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.
My reasoning is that, if the role is already there, we don't really care and should proceed.
https://linear.app/unleash/issue/2-4100/create-reader-project-role
Adds a new Reader predefined project role.
We will need this to solve the issue where read only users should have explicit read only access to private projects, since in order to have access to private projects, you need a project role. Reader is a role with no permissions, so it still matches our RO business rules and allow you to qualify as a RO user, while allowing you to add that user to private projects.
Since we had a unique constraint on the role name, and it's possible that customer instances have a custom role called "Reader", I dropped that unique constraint and instead added a unique constraint on name + type. That way you only need to have unique names if they have the same type.