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

Method GetFileByHashAndCreator

coderd/database/dbauthz/dbauthz.go:3434–3448  ·  view source on GitHub ↗
(ctx context.Context, arg database.GetFileByHashAndCreatorParams)

Source from the content-addressed store, hash-verified

3432}
3433
3434func (q *querier) GetFileByHashAndCreator(ctx context.Context, arg database.GetFileByHashAndCreatorParams) (database.File, error) {
3435 file, err := q.db.GetFileByHashAndCreator(ctx, arg)
3436 if err != nil {
3437 return database.File{}, err
3438 }
3439 err = q.authorizeContext(ctx, policy.ActionRead, file)
3440 if err != nil {
3441 // Check the user's access to the file's templates.
3442 if q.authorizeUpdateFileTemplate(ctx, file) != nil {
3443 return database.File{}, err
3444 }
3445 }
3446
3447 return file, nil
3448}
3449
3450func (q *querier) GetFileByID(ctx context.Context, id uuid.UUID) (database.File, error) {
3451 file, err := q.db.GetFileByID(ctx, id)

Callers

nothing calls this directly

Calls 3

authorizeContextMethod · 0.95

Tested by

no test coverage detected