Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite42dc76

Browse files
committed
removed unnecessary call
1 parent4be8cd7 commite42dc76

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

‎coderd/database/dbauthz/dbauthz.go

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -399,59 +399,59 @@ var (
399399
// AsProvisionerd returns a context with an actor that has permissions required
400400
// for provisionerd to function.
401401
funcAsProvisionerd(ctx context.Context) context.Context {
402-
returnInjectActorToContext(ctx,subjectProvisionerd)
402+
returnAs(ctx,subjectProvisionerd)
403403
}
404404

405405
// AsAutostart returns a context with an actor that has permissions required
406406
// for autostart to function.
407407
funcAsAutostart(ctx context.Context) context.Context {
408-
returnInjectActorToContext(ctx,subjectAutostart)
408+
returnAs(ctx,subjectAutostart)
409409
}
410410

411411
// AsHangDetector returns a context with an actor that has permissions required
412412
// for unhanger.Detector to function.
413413
funcAsHangDetector(ctx context.Context) context.Context {
414-
returnInjectActorToContext(ctx,subjectHangDetector)
414+
returnAs(ctx,subjectHangDetector)
415415
}
416416

417417
// AsKeyRotator returns a context with an actor that has permissions required for rotating crypto keys.
418418
funcAsKeyRotator(ctx context.Context) context.Context {
419-
returnInjectActorToContext(ctx,subjectCryptoKeyRotator)
419+
returnAs(ctx,subjectCryptoKeyRotator)
420420
}
421421

422422
// AsKeyReader returns a context with an actor that has permissions required for reading crypto keys.
423423
funcAsKeyReader(ctx context.Context) context.Context {
424-
returnInjectActorToContext(ctx,subjectCryptoKeyReader)
424+
returnAs(ctx,subjectCryptoKeyReader)
425425
}
426426

427427
// AsNotifier returns a context with an actor that has permissions required for
428428
// creating/reading/updating/deleting notifications.
429429
funcAsNotifier(ctx context.Context) context.Context {
430-
returnInjectActorToContext(ctx,subjectNotifier)
430+
returnAs(ctx,subjectNotifier)
431431
}
432432

433433
// AsResourceMonitor returns a context with an actor that has permissions required for
434434
// updating resource monitors.
435435
funcAsResourceMonitor(ctx context.Context) context.Context {
436-
returnInjectActorToContext(ctx,subjectResourceMonitor)
436+
returnAs(ctx,subjectResourceMonitor)
437437
}
438438

439439
// AsSystemRestricted returns a context with an actor that has permissions
440440
// required for various system operations (login, logout, metrics cache).
441441
funcAsSystemRestricted(ctx context.Context) context.Context {
442-
returnInjectActorToContext(ctx,subjectSystemRestricted)
442+
returnAs(ctx,subjectSystemRestricted)
443443
}
444444

445445
// AsSystemReadProvisionerDaemons returns a context with an actor that has permissions
446446
// to read provisioner daemons.
447447
funcAsSystemReadProvisionerDaemons(ctx context.Context) context.Context {
448-
returnInjectActorToContext(ctx,subjectSystemReadProvisionerDaemons)
448+
returnAs(ctx,subjectSystemReadProvisionerDaemons)
449449
}
450450

451451
// AsPrebuildsOrchestrator returns a context with an actor that has permissions
452452
// to read orchestrator workspace prebuilds.
453453
funcAsPrebuildsOrchestrator(ctx context.Context) context.Context {
454-
returnInjectActorToContext(ctx,subjectPrebuildsOrchestrator)
454+
returnAs(ctx,subjectPrebuildsOrchestrator)
455455
}
456456

457457
varAsRemoveActor= rbac.Subject{
@@ -469,10 +469,6 @@ func As(ctx context.Context, actor rbac.Subject) context.Context {
469469
// should be removed from the context.
470470
returncontext.WithValue(ctx,authContextKey{},nil)
471471
}
472-
returnInjectActorToContext(ctx,actor)
473-
}
474-
475-
funcInjectActorToContext(ctx context.Context,actor rbac.Subject) context.Context {
476472
ifrlogger:=loggermw.RequestLoggerFromContext(ctx);rlogger!=nil {
477473
rlogger.WithAuthContext(actor)
478474
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp