Skip to content

chore: deprecate ResourceSystem #17217

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 1 commit into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions coderd/rbac/object_gen.go

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

6 changes: 6 additions & 0 deletions coderd/rbac/policy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ type PermissionDefinition struct {
// should represent. The key in the actions map is the verb to use
// in the rbac policy.
Actions map[Action]ActionDefinition
// Comment is additional text to include in the generated object comment.
Comment string
}

type ActionDefinition struct {
Expand Down Expand Up @@ -203,6 +205,10 @@ var RBACPermissions = map[string]PermissionDefinition{
ActionUpdate: actDef("update system resources"),
ActionDelete: actDef("delete system resources"),
},
Comment: `
// DEPRECATED: New resources should be created for new things, rather than adding them to System, which has become
// an unmanaged collection of things that don't relate to one another. We can't effectively enforce
// least privilege access control when unrelated resources are grouped together.`,
},
"api_key": {
Actions: map[Action]ActionDefinition{
Expand Down
1 change: 1 addition & 0 deletions scripts/typegen/rbacobject.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var (
{{- range $action, $value := .Actions }}
// - "{{ actionEnum $action }}" :: {{ $value.Description }}
{{- end }}
{{- .Comment }}
Resource{{ $Name }} = Object {
Type: "{{ $element.Type }}",
}
Expand Down
Loading