Skip to content

refactor: consolidate template and workspace acl validation #19192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Aug 7, 2025
Prev Previous commit
Next Next commit
remove unused function
  • Loading branch information
aslilac committed Aug 6, 2025
commit e1d3e3ca88d6df96ac298cd3239cb0e7ed1fd9d1
9 changes: 0 additions & 9 deletions enterprise/coderd/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,6 @@ func convertTemplateUsers(tus []database.TemplateUser, orgIDsByUserIDs map[uuid.
return users
}

func validateTemplateRole(role codersdk.TemplateRole) error {
actions := db2sdk.TemplateRoleActions(role)
if len(actions) == 0 && role != codersdk.TemplateRoleDeleted {
return xerrors.Errorf("role %q is not a valid Template role", role)
}

return nil
}

func convertToTemplateRole(actions []policy.Action) codersdk.TemplateRole {
switch {
case len(actions) == 2 && slice.SameElements(actions, []policy.Action{policy.ActionUse, policy.ActionRead}):
Expand Down
Loading