(ctx context.Context, id uuid.UUID)
| 3448 | } |
| 3449 | |
| 3450 | func (q *querier) GetFileByID(ctx context.Context, id uuid.UUID) (database.File, error) { |
| 3451 | file, err := q.db.GetFileByID(ctx, id) |
| 3452 | if err != nil { |
| 3453 | return database.File{}, err |
| 3454 | } |
| 3455 | err = q.authorizeContext(ctx, policy.ActionRead, file) |
| 3456 | if err != nil { |
| 3457 | // Check the user's access to the file's templates. |
| 3458 | if q.authorizeUpdateFileTemplate(ctx, file) != nil { |
| 3459 | return database.File{}, err |
| 3460 | } |
| 3461 | } |
| 3462 | |
| 3463 | return file, nil |
| 3464 | } |
| 3465 | |
| 3466 | func (q *querier) GetFileTemplates(ctx context.Context, fileID uuid.UUID) ([]database.GetFileTemplatesRow, error) { |
| 3467 | if err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceSystem); err != nil { |
nothing calls this directly
no test coverage detected