-
Notifications
You must be signed in to change notification settings - Fork 357
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
feat: allow users with role Viewer and above to view resource quotas #9822
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9822 +/- ##
==========================================
- Coverage 54.38% 54.35% -0.03%
==========================================
Files 1261 1261
Lines 155770 155842 +72
Branches 3540 3542 +2
==========================================
- Hits 84711 84710 -1
- Misses 70921 70994 +73
Partials 138 138
Flags with carried forward coverage won't be shown. Click here to find out more.
|
✅ Deploy Preview for determined-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
looks like the e2e testing issue is related to a bug in this PR when editing an existing workspace -- the toggles don't seem to work.
master/static/migrations/20240814123944_add-view-resource-quotas-permissions.tx.up.sql
Show resolved
Hide resolved
master/internal/api_workspace.go
Outdated
err = workspace.AuthZProvider.Get().CanGetWorkspaceID( | ||
ctx, *curUser, req.Id, | ||
err = workspace.AuthZProvider.Get().CanViewResourceQuotas( | ||
ctx, *curUser, |
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.
Instead of removing the CanGetWorkspaceID
check, should we maybe do
a.getWorkspaceAndCheckCanDoActions(ctx, req.Id, false, workspace.AuthZProvider.Get().CanGetWorkspace, workspace.AuthZProvider.Get().CanViewResourceQuotas)
so that we perform both of these checks? Or do we not need the CanGetWorkspaceID
check here?
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 don't think we can check 2 permissions at a time, so I added both checks in a different way
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.
This LGTM modulo one comment!
Can we maybe add some unit tests in postgres_rbac_intg_test.go
just to make sure the permissions are properly added to these respective roles?
a888f16
to
4b0d1cd
Compare
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.
web LGTM
webui/react/src/pages/WorkspaceList/WorkspaceActionDropdown.tsx
Outdated
Show resolved
Hide resolved
webui/react/src/pages/WorkspaceList/WorkspaceActionDropdown.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.
LGTM, awesome work!
Ticket
DET-10430
Description
Allowed users with Viewer, Editor, Editor Restricted, Editor Project Restricted, Gen AI and Workspace Admin to be able to view resource quotas in the WebUI when RBAC is enabled. Cluster Admin can still modify and view resource quotas. Allowed all users to view quotas when RBAC is disabled. This involved allowing users who cannot modify the workspaces to also see the Edit Workspace Modal but they will be seeing a "Config" option instead of "Edit Workspace".
Test Plan
Set up minikube and create a namespace "test-ns" with a resource quota of 2.
Checklist
docs/release-notes/
See Release Note for details.