TODO: Handle org scoped lookups
(ctx context.Context, arg database.CustomRolesParams)
| 1885 | |
| 1886 | // TODO: Handle org scoped lookups |
| 1887 | func (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 | |
| 1899 | func (q *querier) DeleteAIProviderByID(ctx context.Context, id uuid.UUID) error { |
| 1900 | if err := q.authorizeContext(ctx, policy.ActionDelete, rbac.ResourceAIProvider); err != nil { |
nothing calls this directly
no test coverage detected