Skip to content

chore: remove rbac psuedo resources, add custom verbs #13276

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

Merged
merged 24 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update roles
  • Loading branch information
Emyrk committed May 15, 2024
commit c70c5268589b0ec851b6ce815b04d5c59d0a79a4
17 changes: 8 additions & 9 deletions coderd/rbac/object_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions coderd/rbac/object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ func TestAllResources(t *testing.T) {
var typeNames []string
resources := rbac.AllResources()
for _, r := range resources {
if r.Type == "" {
t.Errorf("empty type name: %s", r.Type)
if r.RBACObject().Type == "" {
t.Errorf("empty type name: %s", r.RBACObject().Type)
continue
}
if slice.Contains(typeNames, r.Type) {
t.Errorf("duplicate type name: %s", r.Type)
if slice.Contains(typeNames, r.RBACObject().Type) {
t.Errorf("duplicate type name: %s", r.RBACObject().Type)
continue
}
typeNames = append(typeNames, r.Type)
typeNames = append(typeNames, r.RBACObject().Type)
}
}
1 change: 1 addition & 0 deletions coderd/rbac/policy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ var RBACPermissions = map[string]PermissionDefinition{
"assign_org_role": {
Actions: map[Action]ActionDefinition{
ActionAssign: actDef(0, "ability to assign org scoped roles"),
ActionRead: actDef(0, "view what roles are assignable"),
ActionDelete: actDef(0, "ability to delete org scoped roles"),
},
},
Expand Down