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

Method DeleteCustomRole

coderd/database/dbauthz/dbauthz.go:2037–2046  ·  view source on GitHub ↗
(ctx context.Context, arg database.DeleteCustomRoleParams)

Source from the content-addressed store, hash-verified

2035}
2036
2037func (q *querier) DeleteCustomRole(ctx context.Context, arg database.DeleteCustomRoleParams) error {
2038 if !arg.OrganizationID.Valid || arg.OrganizationID.UUID == uuid.Nil {
2039 return NotAuthorizedError{Err: xerrors.New("custom roles must belong to an organization")}
2040 }
2041 if err := q.authorizeContext(ctx, policy.ActionDelete, rbac.ResourceAssignOrgRole.InOrg(arg.OrganizationID.UUID)); err != nil {
2042 return err
2043 }
2044
2045 return q.db.DeleteCustomRole(ctx, arg)
2046}
2047
2048func (q *querier) DeleteExpiredAPIKeys(ctx context.Context, arg database.DeleteExpiredAPIKeysParams) (int64, error) {
2049 // Requires DELETE across all API keys.

Callers

nothing calls this directly

Calls 4

authorizeContextMethod · 0.95
InOrgMethod · 0.80
NewMethod · 0.65
DeleteCustomRoleMethod · 0.65

Tested by

no test coverage detected