mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
chore: implement databased backend for custom roles (#13295)
Includes db schema and dbauthz layer for upserting custom roles. Unit test in `customroles_test.go` verify against escalating permissions through this feature.
This commit is contained in:
20
coderd/database/migrations/testdata/fixtures/000209_custom_roles.up.sql
vendored
Normal file
20
coderd/database/migrations/testdata/fixtures/000209_custom_roles.up.sql
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
INSERT INTO
|
||||
custom_roles (
|
||||
name,
|
||||
display_name,
|
||||
site_permissions,
|
||||
org_permissions,
|
||||
user_permissions,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
'custom-role',
|
||||
'Custom Role',
|
||||
'[{"negate":false,"resource_type":"deployment_config","action":"update"},{"negate":false,"resource_type":"workspace","action":"read"}]',
|
||||
'{}',
|
||||
'[{"negate":false,"resource_type":"workspace","action":"read"}]',
|
||||
date_trunc('hour', NOW()),
|
||||
date_trunc('hour', NOW()) + '30 minute'::interval
|
||||
);
|
Reference in New Issue
Block a user