mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
31 lines
772 B
Go Template
31 lines
772 B
Go Template
// Code generated by rbacgen/main.go. DO NOT EDIT.
|
|
package codersdk
|
|
|
|
type RBACResource string
|
|
|
|
const (
|
|
{{- range $element := . }}
|
|
Resource{{ pascalCaseName $element.FunctionName }} RBACResource = "{{ $element.Type }}"
|
|
{{- end }}
|
|
)
|
|
|
|
type RBACAction string
|
|
|
|
const (
|
|
{{- range $element := actionsList }}
|
|
{{ $element.Enum }} RBACAction = "{{ $element.Value }}"
|
|
{{- end }}
|
|
)
|
|
|
|
// RBACResourceActions is the mapping of resources to which actions are valid for
|
|
// said resource type.
|
|
var RBACResourceActions = map[RBACResource][]RBACAction{
|
|
{{- range $element := . }}
|
|
Resource{{ pascalCaseName $element.FunctionName }}: {
|
|
{{- range $actionValue, $_ := $element.Actions }}
|
|
{{- actionEnum $actionValue -}},
|
|
{{- end -}}
|
|
},
|
|
{{- end }}
|
|
}
|