MCPcopy Index your code
hub / github.com/coder/coder / ValidateRole

Method ValidateRole

coderd/workspaces.go:3067–3074  ·  view source on GitHub ↗
(role codersdk.WorkspaceRole)

Source from the content-addressed store, hash-verified

3065}
3066
3067func (WorkspaceACLUpdateValidator) ValidateRole(role codersdk.WorkspaceRole) error {
3068 actions := db2sdk.WorkspaceRoleActions(role)
3069 if len(actions) == 0 && role != codersdk.WorkspaceRoleDeleted {
3070 return xerrors.Errorf("role %q is not a valid workspace role", role)
3071 }
3072
3073 return nil
3074}
3075
3076func convertToWorkspaceRole(actions []policy.Action) codersdk.WorkspaceRole {
3077 switch {

Callers

nothing calls this directly

Calls 2

WorkspaceRoleActionsFunction · 0.92
ErrorfMethod · 0.45

Tested by

no test coverage detected