mirror of
https://github.com/coder/coder.git
synced 2025-07-01 16:07:26 +00:00
Deprecates `ResourceSystem`. It's a large collection of unrelated things, and violates the principle of least privilege because to get access to low-security stuff like various statistics, you also get access to serious-security stuff like crypto keys. We should eventually break it up and remove it, but the least we can do for now is not make the problem worse.
41 lines
875 B
Go Template
41 lines
875 B
Go Template
// Code generated by typegen/main.go. DO NOT EDIT.
|
|
package rbac
|
|
|
|
import "github.com/coder/coder/v2/coderd/rbac/policy"
|
|
|
|
// Objecter returns the RBAC object for itself.
|
|
type Objecter interface {
|
|
RBACObject() Object
|
|
}
|
|
|
|
var (
|
|
{{- range $element := . }}
|
|
{{- $Name := pascalCaseName $element.FunctionName }}
|
|
// Resource{{ $Name }}
|
|
// Valid Actions
|
|
{{- range $action, $value := .Actions }}
|
|
// - "{{ actionEnum $action }}" :: {{ $value.Description }}
|
|
{{- end }}
|
|
{{- .Comment }}
|
|
Resource{{ $Name }} = Object {
|
|
Type: "{{ $element.Type }}",
|
|
}
|
|
{{ end -}}
|
|
)
|
|
|
|
func AllResources() []Objecter {
|
|
return []Objecter{
|
|
{{- range $element := . }}
|
|
Resource{{ pascalCaseName $element.FunctionName }},
|
|
{{- end }}
|
|
}
|
|
}
|
|
|
|
func AllActions() []policy.Action {
|
|
return []policy.Action {
|
|
{{- range $element := actionsList }}
|
|
policy.{{ $element.Enum }},
|
|
{{- end }}
|
|
}
|
|
}
|