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

Method GetTemplateUserRoles

coderd/database/dbauthz/dbauthz.go:8458–8468  ·  view source on GitHub ↗
(ctx context.Context, id uuid.UUID)

Source from the content-addressed store, hash-verified

8456}
8457
8458func (q *querier) GetTemplateUserRoles(ctx context.Context, id uuid.UUID) ([]database.TemplateUser, error) {
8459 // An actor is authorized to query template user roles if they are authorized to update the template.
8460 template, err := q.db.GetTemplateByID(ctx, id)
8461 if err != nil {
8462 return nil, err
8463 }
8464 if err := q.authorizeContext(ctx, policy.ActionUpdate, template); err != nil {
8465 return nil, err
8466 }
8467 return q.db.GetTemplateUserRoles(ctx, id)
8468}
8469
8470func (q *querier) GetAuthorizedWorkspaces(ctx context.Context, arg database.GetWorkspacesParams, _ rbac.PreparedAuthorized) ([]database.GetWorkspacesRow, error) {
8471 // TODO Delete this function, all GetWorkspaces should be authorized. For now just call GetWorkspaces on the authz querier.

Callers

nothing calls this directly

Calls 3

authorizeContextMethod · 0.95
GetTemplateByIDMethod · 0.65
GetTemplateUserRolesMethod · 0.65

Tested by

no test coverage detected