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:
Steven Masley
2024-05-16 13:11:26 -05:00
committed by GitHub
parent 194be12133
commit cf91eff7cf
21 changed files with 854 additions and 19 deletions

View 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
);