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

Method CustomRoles

coderd/database/dbauthz/dbauthz.go:1887–1897  ·  view source on GitHub ↗

TODO: Handle org scoped lookups

(ctx context.Context, arg database.CustomRolesParams)

Source from the content-addressed store, hash-verified

1885
1886// TODO: Handle org scoped lookups
1887func (q *querier) CustomRoles(ctx context.Context, arg database.CustomRolesParams) ([]database.CustomRole, error) {
1888 roleObject := rbac.ResourceAssignRole
1889 if arg.OrganizationID != uuid.Nil {
1890 roleObject = rbac.ResourceAssignOrgRole.InOrg(arg.OrganizationID)
1891 }
1892 if err := q.authorizeContext(ctx, policy.ActionRead, roleObject); err != nil {
1893 return nil, err
1894 }
1895
1896 return q.db.CustomRoles(ctx, arg)
1897}
1898
1899func (q *querier) DeleteAIProviderByID(ctx context.Context, id uuid.UUID) error {
1900 if err := q.authorizeContext(ctx, policy.ActionDelete, rbac.ResourceAIProvider); err != nil {

Callers

nothing calls this directly

Calls 3

authorizeContextMethod · 0.95
InOrgMethod · 0.80
CustomRolesMethod · 0.65

Tested by

no test coverage detected