asOwner sets up a dbauthz context for the given owner so that subsequent database calls are scoped to what that user can access.
(ctx context.Context, db database.Store, ownerID uuid.UUID)
| 148 | // asOwner sets up a dbauthz context for the given owner so that |
| 149 | // subsequent database calls are scoped to what that user can access. |
| 150 | func asOwner(ctx context.Context, db database.Store, ownerID uuid.UUID) (context.Context, error) { |
| 151 | actor, _, err := httpmw.UserRBACSubject(ctx, db, ownerID, rbac.ScopeAll) |
| 152 | if err != nil { |
| 153 | return ctx, xerrors.Errorf("load user authorization: %w", err) |
| 154 | } |
| 155 | return dbauthz.As(ctx, actor), nil |
| 156 | } |
no test coverage detected