mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +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:
@ -248,6 +248,15 @@ func TestRolePermissions(t *testing.T) {
|
||||
false: {otherOrgAdmin, otherOrgMember, memberMe, userAdmin},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "CreateCustomRole",
|
||||
Actions: []policy.Action{policy.ActionCreate},
|
||||
Resource: rbac.ResourceAssignRole,
|
||||
AuthorizeMap: map[bool][]authSubject{
|
||||
true: {owner},
|
||||
false: {userAdmin, orgAdmin, orgMemberMe, otherOrgAdmin, otherOrgMember, memberMe, templateAdmin},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "RoleAssignment",
|
||||
Actions: []policy.Action{policy.ActionAssign, policy.ActionDelete},
|
||||
@ -380,7 +389,7 @@ func TestRolePermissions(t *testing.T) {
|
||||
},
|
||||
// Some admin style resources
|
||||
{
|
||||
Name: "Licences",
|
||||
Name: "Licenses",
|
||||
Actions: []policy.Action{policy.ActionCreate, policy.ActionRead, policy.ActionDelete},
|
||||
Resource: rbac.ResourceLicense,
|
||||
AuthorizeMap: map[bool][]authSubject{
|
||||
|
Reference in New Issue
Block a user