@@ -530,9 +530,9 @@ func As(ctx context.Context, actor rbac.Subject) context.Context {
530
530
// running the insertFunc. The insertFunc is expected to return the object that
531
531
// was inserted.
532
532
func insert [
533
- ObjectType any ,
534
- ArgumentType any ,
535
- Insert func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
533
+ ObjectType any ,
534
+ ArgumentType any ,
535
+ Insert func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
536
536
](
537
537
logger slog.Logger ,
538
538
authorizer rbac.Authorizer ,
@@ -543,9 +543,9 @@ Insert func(ctx context.Context, arg ArgumentType) (ObjectType, error),
543
543
}
544
544
545
545
func insertWithAction [
546
- ObjectType any ,
547
- ArgumentType any ,
548
- Insert func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
546
+ ObjectType any ,
547
+ ArgumentType any ,
548
+ Insert func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
549
549
](
550
550
logger slog.Logger ,
551
551
authorizer rbac.Authorizer ,
@@ -572,10 +572,10 @@ Insert func(ctx context.Context, arg ArgumentType) (ObjectType, error),
572
572
}
573
573
574
574
func deleteQ [
575
- ObjectType rbac.Objecter ,
576
- ArgumentType any ,
577
- Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
578
- Delete func (ctx context.Context , arg ArgumentType ) error ,
575
+ ObjectType rbac.Objecter ,
576
+ ArgumentType any ,
577
+ Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
578
+ Delete func (ctx context.Context , arg ArgumentType ) error ,
579
579
](
580
580
logger slog.Logger ,
581
581
authorizer rbac.Authorizer ,
@@ -587,10 +587,10 @@ Delete func(ctx context.Context, arg ArgumentType) error,
587
587
}
588
588
589
589
func updateWithReturn [
590
- ObjectType rbac.Objecter ,
591
- ArgumentType any ,
592
- Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
593
- UpdateQuery func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
590
+ ObjectType rbac.Objecter ,
591
+ ArgumentType any ,
592
+ Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
593
+ UpdateQuery func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
594
594
](
595
595
logger slog.Logger ,
596
596
authorizer rbac.Authorizer ,
@@ -601,10 +601,10 @@ UpdateQuery func(ctx context.Context, arg ArgumentType) (ObjectType, error),
601
601
}
602
602
603
603
func update [
604
- ObjectType rbac.Objecter ,
605
- ArgumentType any ,
606
- Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
607
- Exec func (ctx context.Context , arg ArgumentType ) error ,
604
+ ObjectType rbac.Objecter ,
605
+ ArgumentType any ,
606
+ Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
607
+ Exec func (ctx context.Context , arg ArgumentType ) error ,
608
608
](
609
609
logger slog.Logger ,
610
610
authorizer rbac.Authorizer ,
@@ -622,9 +622,9 @@ Exec func(ctx context.Context, arg ArgumentType) error,
622
622
// user cannot read the resource. This is because the resource details are
623
623
// required to run a proper authorization check.
624
624
func fetchWithAction [
625
- ArgumentType any ,
626
- ObjectType rbac.Objecter ,
627
- DatabaseFunc func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
625
+ ArgumentType any ,
626
+ ObjectType rbac.Objecter ,
627
+ DatabaseFunc func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
628
628
](
629
629
logger slog.Logger ,
630
630
authorizer rbac.Authorizer ,
@@ -655,9 +655,9 @@ DatabaseFunc func(ctx context.Context, arg ArgumentType) (ObjectType, error),
655
655
}
656
656
657
657
func fetch [
658
- ArgumentType any ,
659
- ObjectType rbac.Objecter ,
660
- DatabaseFunc func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
658
+ ArgumentType any ,
659
+ ObjectType rbac.Objecter ,
660
+ DatabaseFunc func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
661
661
](
662
662
logger slog.Logger ,
663
663
authorizer rbac.Authorizer ,
@@ -670,10 +670,10 @@ DatabaseFunc func(ctx context.Context, arg ArgumentType) (ObjectType, error),
670
670
// from SQL 'exec' functions which only return an error.
671
671
// See fetchAndQuery for more information.
672
672
func fetchAndExec [
673
- ObjectType rbac.Objecter ,
674
- ArgumentType any ,
675
- Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
676
- Exec func (ctx context.Context , arg ArgumentType ) error ,
673
+ ObjectType rbac.Objecter ,
674
+ ArgumentType any ,
675
+ Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
676
+ Exec func (ctx context.Context , arg ArgumentType ) error ,
677
677
](
678
678
logger slog.Logger ,
679
679
authorizer rbac.Authorizer ,
@@ -696,10 +696,10 @@ Exec func(ctx context.Context, arg ArgumentType) error,
696
696
// **before** the query runs. The returns from the fetch are only used to
697
697
// assert rbac. The final return of this function comes from the Query function.
698
698
func fetchAndQuery [
699
- ObjectType rbac.Objecter ,
700
- ArgumentType any ,
701
- Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
702
- Query func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
699
+ ObjectType rbac.Objecter ,
700
+ ArgumentType any ,
701
+ Fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
702
+ Query func (ctx context.Context , arg ArgumentType ) (ObjectType , error ),
703
703
](
704
704
logger slog.Logger ,
705
705
authorizer rbac.Authorizer ,
@@ -733,9 +733,9 @@ Query func(ctx context.Context, arg ArgumentType) (ObjectType, error),
733
733
// fetchWithPostFilter is like fetch, but works with lists of objects.
734
734
// SQL filters are much more optimal.
735
735
func fetchWithPostFilter [
736
- ArgumentType any ,
737
- ObjectType rbac.Objecter ,
738
- DatabaseFunc func (ctx context.Context , arg ArgumentType ) ([]ObjectType , error ),
736
+ ArgumentType any ,
737
+ ObjectType rbac.Objecter ,
738
+ DatabaseFunc func (ctx context.Context , arg ArgumentType ) ([]ObjectType , error ),
739
739
](
740
740
authorizer rbac.Authorizer ,
741
741
action policy.Action ,
0 commit comments