Files
coder/scripts/typegen/codersdk.gotmpl
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
772 B
Go Template
Raw Normal View History

// Code generated by typegen/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 := . }}
2024-06-03 14:33:37 -05:00
Resource{{ pascalCaseName $element.FunctionName }}: {
{{- range $actionValue, $_ := $element.Actions }}
{{- actionEnum $actionValue -}},
{{- end -}}
},
{{- end }}
}