mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
Closes https://github.com/coder/coder/issues/15074 We have a hard-coded list of countries at https://github.com/coder/coder/blob/main/site/src/pages/SetupPage/countries.tsx. This means Go code in coder/coder doesn't have an easy way of utilizing it. ## Solution Generate countries.tsx from Go code. Generated by `scripts/apitypings`
20 lines
685 B
Plaintext
20 lines
685 B
Plaintext
// Code generated by typegen/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 }}
|
|
};
|