mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
* chore: generate rbac resource types to typescript The existing typesGenerated.ts cannot support this as the generator only inspects the types, not the values. So traversing the value AST would have to be added. The rbac gen is already used for the sdk, this extends it to the typescript
20 lines
685 B
Plaintext
20 lines
685 B
Plaintext
// Code generated by rbacgen/main.go. DO NOT EDIT.
|
|
|
|
import type { RBACAction, RBACResource } from "./typesGenerated";
|
|
|
|
// RBACResourceActions maps RBAC resources to their possible actions.
|
|
// Descriptions are included to document the purpose of each action.
|
|
// Source is in 'coderd/rbac/policy/policy.go'.
|
|
export const RBACResourceActions: Partial<
|
|
Record<RBACResource, Partial<Record<RBACAction, string>>>
|
|
> = {
|
|
{{- range $element := . }}
|
|
{{- if eq $element.Type "*" }}{{ continue }}{{ end }}
|
|
{{ $element.Type }}: {
|
|
{{- range $actionValue, $actionDescription := $element.Actions }}
|
|
{{ $actionValue }}: "{{ $actionDescription }}",
|
|
{{- end }}
|
|
},
|
|
{{- end }}
|
|
};
|