feat(721): Access Controls for Projects API#735
Open
rmonteseba wants to merge 1 commit into
Open
Conversation
| /** | ||
| * Single source of truth for permission checks in the UI. | ||
| * | ||
| * Rule of thumb (confirmed across Project and Notebook permission tickets): |
Collaborator
There was a problem hiding this comment.
Please remove the "confirmed" part, it looks alien in class documentation
| selector: '[hasPermission]', | ||
| standalone: true, | ||
| }) | ||
| export class HasPermissionDirective { |
Collaborator
There was a problem hiding this comment.
I like the idea of a directive, but I have a doubt. If we are asked to disable the control instead of hiding it, do we have a way to do so?
Also, I'm thinking of Experiment screen. In our tables, if user doesn't have EDIT permission or experiment is read-only (when status is other than OPEN/REOPEN) we definitely cannot hide cells and have to disable them
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
currentPermissions: ApplicationPermission[]to theProjectDTO — previously returned by the backend but untyped/unused on the frontend.PermissionedEntityinterface,PermissionService.hasPermission(permission, entity?), and a*hasPermissionstructural directive (defaults to hidden when data hasn't loaded yet).currentPermissions.CREATE_PROJECTS.EDIT_PROJECTS.EDIT_PROJECTS, via newrequiredPermission/entityinputs (defaults preserve old behavior when unset).MANAGE_PROJECT_ACCESS, via the same new inputs.403responses instead of the generic server error text, as a safety net for stale UI/edge cases.PermissionedEntityto their DTO and reusePermissionService/*hasPermissionwithout touchingTeamComponent/AttachmentsComponentagain.add memberandeditCTAs)add memberandeditCTAs)