-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add rbac for strict job queue control (#927)
implement RBAC for controlling job queue give permission to ClusterAdmin role to make changes in the strict case [excluding e2e_tests changes]
- Loading branch information
1 parent
33b3f2d
commit 93b1a49
Showing
4 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
3 changes: 3 additions & 0 deletions
3
master/static/migrations/20230627154016_precanned-jobq-control-permissions.tx.down.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DELETE FROM permission_assignments WHERE permission_id = 8101; | ||
|
||
DELETE FROM permissions WHERE id = 8101; |
24 changes: 24 additions & 0 deletions
24
master/static/migrations/20230627154016_precanned-jobq-control-permissions.tx.up.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- // Ability to control strict job queue. | ||
-- PERMISSION_TYPE_CONTROL_STRICT_JOB_QUEUE = 8101; | ||
|
||
INSERT into permissions(id, name, global_only) VALUES | ||
(8101, 'control strict job queue', true); | ||
|
||
|
||
-- determined> select * from roles; | ||
-- +----+---------------------+----------------------------+ | ||
-- | id | role_name | created_at | | ||
-- |----+---------------------+----------------------------| | ||
-- | 1 | ClusterAdmin | 2023-05-30 16:20:54.825443 | | ||
-- | 2 | WorkspaceAdmin | 2023-05-30 16:20:54.825443 | | ||
-- | 3 | WorkspaceCreator | 2023-05-30 16:20:54.825443 | | ||
-- | 4 | Viewer | 2023-05-30 16:20:54.825443 | | ||
-- | 5 | Editor | 2023-05-30 16:20:54.825443 | | ||
-- | 6 | ModelRegistryViewer | 2023-05-30 16:20:55.136146 | | ||
-- +----+---------------------+----------------------------+ | ||
-- SELECT 6 | ||
|
||
INSERT INTO permission_assignments (permission_id, role_id) | ||
SELECT 8101, roles.id | ||
FROM roles | ||
WHERE roles.role_name IN ('ClusterAdmin'); |