@@ -483,9 +483,9 @@ func As(ctx context.Context, actor rbac.Subject) context.Context {
483
483
// running the insertFunc. The insertFunc is expected to return the object that
484
484
// was inserted.
485
485
func insert [
486
- ObjectType any ,
487
- ArgumentType any ,
488
- Insert func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
486
+ ObjectType any ,
487
+ ArgumentType any ,
488
+ Insert func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
489
489
](
490
490
logger slog.Logger ,
491
491
authorizer rbac.Authorizer ,
@@ -496,9 +496,9 @@ Insert func(ctx context.Context, arg ArgumentType) (ObjectType, error),
496
496
}
497
497
498
498
func insertWithAction [
499
- ObjectType any ,
500
- ArgumentType any ,
501
- Insert func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
499
+ ObjectType any ,
500
+ ArgumentType any ,
501
+ Insert func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
502
502
](
503
503
logger slog.Logger ,
504
504
authorizer rbac.Authorizer ,
@@ -525,10 +525,10 @@ Insert func(ctx context.Context, arg ArgumentType) (ObjectType, error),
525
525
}
526
526
527
527
func deleteQ [
528
- ObjectType rbac.Objecter ,
529
- ArgumentType any ,
530
- Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
531
- Delete func (ctx context.Context ,arg ArgumentType )error ,
528
+ ObjectType rbac.Objecter ,
529
+ ArgumentType any ,
530
+ Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
531
+ Delete func (ctx context.Context ,arg ArgumentType )error ,
532
532
](
533
533
logger slog.Logger ,
534
534
authorizer rbac.Authorizer ,
@@ -540,10 +540,10 @@ Delete func(ctx context.Context, arg ArgumentType) error,
540
540
}
541
541
542
542
func updateWithReturn [
543
- ObjectType rbac.Objecter ,
544
- ArgumentType any ,
545
- Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
546
- UpdateQuery func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
543
+ ObjectType rbac.Objecter ,
544
+ ArgumentType any ,
545
+ Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
546
+ UpdateQuery func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
547
547
](
548
548
logger slog.Logger ,
549
549
authorizer rbac.Authorizer ,
@@ -554,10 +554,10 @@ UpdateQuery func(ctx context.Context, arg ArgumentType) (ObjectType, error),
554
554
}
555
555
556
556
func update [
557
- ObjectType rbac.Objecter ,
558
- ArgumentType any ,
559
- Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
560
- Exec func (ctx context.Context ,arg ArgumentType )error ,
557
+ ObjectType rbac.Objecter ,
558
+ ArgumentType any ,
559
+ Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
560
+ Exec func (ctx context.Context ,arg ArgumentType )error ,
561
561
](
562
562
logger slog.Logger ,
563
563
authorizer rbac.Authorizer ,
@@ -575,9 +575,9 @@ Exec func(ctx context.Context, arg ArgumentType) error,
575
575
// user cannot read the resource. This is because the resource details are
576
576
// required to run a proper authorization check.
577
577
func fetchWithAction [
578
- ArgumentType any ,
579
- ObjectType rbac.Objecter ,
580
- DatabaseFunc func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
578
+ ArgumentType any ,
579
+ ObjectType rbac.Objecter ,
580
+ DatabaseFunc func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
581
581
](
582
582
logger slog.Logger ,
583
583
authorizer rbac.Authorizer ,
@@ -608,9 +608,9 @@ DatabaseFunc func(ctx context.Context, arg ArgumentType) (ObjectType, error),
608
608
}
609
609
610
610
func fetch [
611
- ArgumentType any ,
612
- ObjectType rbac.Objecter ,
613
- DatabaseFunc func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
611
+ ArgumentType any ,
612
+ ObjectType rbac.Objecter ,
613
+ DatabaseFunc func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
614
614
](
615
615
logger slog.Logger ,
616
616
authorizer rbac.Authorizer ,
@@ -623,10 +623,10 @@ DatabaseFunc func(ctx context.Context, arg ArgumentType) (ObjectType, error),
623
623
// from SQL 'exec' functions which only return an error.
624
624
// See fetchAndQuery for more information.
625
625
func fetchAndExec [
626
- ObjectType rbac.Objecter ,
627
- ArgumentType any ,
628
- Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
629
- Exec func (ctx context.Context ,arg ArgumentType )error ,
626
+ ObjectType rbac.Objecter ,
627
+ ArgumentType any ,
628
+ Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
629
+ Exec func (ctx context.Context ,arg ArgumentType )error ,
630
630
](
631
631
logger slog.Logger ,
632
632
authorizer rbac.Authorizer ,
@@ -649,10 +649,10 @@ Exec func(ctx context.Context, arg ArgumentType) error,
649
649
// **before** the query runs. The returns from the fetch are only used to
650
650
// assert rbac. The final return of this function comes from the Query function.
651
651
func fetchAndQuery [
652
- ObjectType rbac.Objecter ,
653
- ArgumentType any ,
654
- Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
655
- Query func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
652
+ ObjectType rbac.Objecter ,
653
+ ArgumentType any ,
654
+ Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
655
+ Query func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
656
656
](
657
657
logger slog.Logger ,
658
658
authorizer rbac.Authorizer ,
@@ -686,9 +686,9 @@ Query func(ctx context.Context, arg ArgumentType) (ObjectType, error),
686
686
// fetchWithPostFilter is like fetch, but works with lists of objects.
687
687
// SQL filters are much more optimal.
688
688
func fetchWithPostFilter [
689
- ArgumentType any ,
690
- ObjectType rbac.Objecter ,
691
- DatabaseFunc func (ctx context.Context ,arg ArgumentType ) ([]ObjectType ,error ),
689
+ ArgumentType any ,
690
+ ObjectType rbac.Objecter ,
691
+ DatabaseFunc func (ctx context.Context ,arg ArgumentType ) ([]ObjectType ,error ),
692
692
](
693
693
authorizer rbac.Authorizer ,
694
694
action policy.Action ,