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

Method GetTemplateGroupRoles

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

Source from the content-addressed store, hash-verified

8444}
8445
8446func (q *querier) GetTemplateGroupRoles(ctx context.Context, id uuid.UUID) ([]database.TemplateGroup, error) {
8447 // An actor is authorized to read template group roles if they are authorized to update the template.
8448 template, err := q.db.GetTemplateByID(ctx, id)
8449 if err != nil {
8450 return nil, err
8451 }
8452 if err := q.authorizeContext(ctx, policy.ActionUpdate, template); err != nil {
8453 return nil, err
8454 }
8455 return q.db.GetTemplateGroupRoles(ctx, id)
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.

Callers

nothing calls this directly

Calls 3

authorizeContextMethod · 0.95
GetTemplateByIDMethod · 0.65
GetTemplateGroupRolesMethod · 0.65

Tested by

no test coverage detected