Files
coder/scripts/rbacgen/rbacobject.gotmpl
Steven Masley 1f5788feff chore: remove rbac psuedo resources, add custom verbs (#13276)
Removes our pseudo rbac resources like `WorkspaceApplicationConnect` in favor of additional verbs like `ssh`. This is to make more intuitive permissions for building custom roles.

The source of truth is now `policy.go`
2024-05-15 11:09:42 -05:00

40 lines
857 B
Go Template

// Code generated by rbacgen/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 }}
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 }}
}
}