@@ -307,9 +307,9 @@ func As(ctx context.Context, actor rbac.Subject) context.Context {
307
307
// running the insertFunc. The insertFunc is expected to return the object that
308
308
// was inserted.
309
309
func insert [
310
- ObjectType any ,
311
- ArgumentType any ,
312
- Insert func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
310
+ ObjectType any ,
311
+ ArgumentType any ,
312
+ Insert func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
313
313
](
314
314
logger slog.Logger ,
315
315
authorizer rbac.Authorizer ,
@@ -320,9 +320,9 @@ Insert func(ctx context.Context, arg ArgumentType) (ObjectType, error),
320
320
}
321
321
322
322
func insertWithAction [
323
- ObjectType any ,
324
- ArgumentType any ,
325
- Insert func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
323
+ ObjectType any ,
324
+ ArgumentType any ,
325
+ Insert func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
326
326
](
327
327
logger slog.Logger ,
328
328
authorizer rbac.Authorizer ,
@@ -349,10 +349,10 @@ Insert func(ctx context.Context, arg ArgumentType) (ObjectType, error),
349
349
}
350
350
351
351
func deleteQ [
352
- ObjectType rbac.Objecter ,
353
- ArgumentType any ,
354
- Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
355
- Delete func (ctx context.Context ,arg ArgumentType )error ,
352
+ ObjectType rbac.Objecter ,
353
+ ArgumentType any ,
354
+ Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
355
+ Delete func (ctx context.Context ,arg ArgumentType )error ,
356
356
](
357
357
logger slog.Logger ,
358
358
authorizer rbac.Authorizer ,
@@ -364,10 +364,10 @@ Delete func(ctx context.Context, arg ArgumentType) error,
364
364
}
365
365
366
366
func updateWithReturn [
367
- ObjectType rbac.Objecter ,
368
- ArgumentType any ,
369
- Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
370
- UpdateQuery func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
367
+ ObjectType rbac.Objecter ,
368
+ ArgumentType any ,
369
+ Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
370
+ UpdateQuery func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
371
371
](
372
372
logger slog.Logger ,
373
373
authorizer rbac.Authorizer ,
@@ -378,10 +378,10 @@ UpdateQuery func(ctx context.Context, arg ArgumentType) (ObjectType, error),
378
378
}
379
379
380
380
func update [
381
- ObjectType rbac.Objecter ,
382
- ArgumentType any ,
383
- Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
384
- Exec func (ctx context.Context ,arg ArgumentType )error ,
381
+ ObjectType rbac.Objecter ,
382
+ ArgumentType any ,
383
+ Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
384
+ Exec func (ctx context.Context ,arg ArgumentType )error ,
385
385
](
386
386
logger slog.Logger ,
387
387
authorizer rbac.Authorizer ,
@@ -399,9 +399,9 @@ Exec func(ctx context.Context, arg ArgumentType) error,
399
399
// user cannot read the resource. This is because the resource details are
400
400
// required to run a proper authorization check.
401
401
func fetchWithAction [
402
- ArgumentType any ,
403
- ObjectType rbac.Objecter ,
404
- DatabaseFunc func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
402
+ ArgumentType any ,
403
+ ObjectType rbac.Objecter ,
404
+ DatabaseFunc func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
405
405
](
406
406
logger slog.Logger ,
407
407
authorizer rbac.Authorizer ,
@@ -432,9 +432,9 @@ DatabaseFunc func(ctx context.Context, arg ArgumentType) (ObjectType, error),
432
432
}
433
433
434
434
func fetch [
435
- ArgumentType any ,
436
- ObjectType rbac.Objecter ,
437
- DatabaseFunc func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
435
+ ArgumentType any ,
436
+ ObjectType rbac.Objecter ,
437
+ DatabaseFunc func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
438
438
](
439
439
logger slog.Logger ,
440
440
authorizer rbac.Authorizer ,
@@ -447,10 +447,10 @@ DatabaseFunc func(ctx context.Context, arg ArgumentType) (ObjectType, error),
447
447
// from SQL 'exec' functions which only return an error.
448
448
// See fetchAndQuery for more information.
449
449
func fetchAndExec [
450
- ObjectType rbac.Objecter ,
451
- ArgumentType any ,
452
- Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
453
- Exec func (ctx context.Context ,arg ArgumentType )error ,
450
+ ObjectType rbac.Objecter ,
451
+ ArgumentType any ,
452
+ Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
453
+ Exec func (ctx context.Context ,arg ArgumentType )error ,
454
454
](
455
455
logger slog.Logger ,
456
456
authorizer rbac.Authorizer ,
@@ -473,10 +473,10 @@ Exec func(ctx context.Context, arg ArgumentType) error,
473
473
// **before** the query runs. The returns from the fetch are only used to
474
474
// assert rbac. The final return of this function comes from the Query function.
475
475
func fetchAndQuery [
476
- ObjectType rbac.Objecter ,
477
- ArgumentType any ,
478
- Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
479
- Query func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
476
+ ObjectType rbac.Objecter ,
477
+ ArgumentType any ,
478
+ Fetch func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
479
+ Query func (ctx context.Context ,arg ArgumentType ) (ObjectType ,error ),
480
480
](
481
481
logger slog.Logger ,
482
482
authorizer rbac.Authorizer ,
@@ -510,9 +510,9 @@ Query func(ctx context.Context, arg ArgumentType) (ObjectType, error),
510
510
// fetchWithPostFilter is like fetch, but works with lists of objects.
511
511
// SQL filters are much more optimal.
512
512
func fetchWithPostFilter [
513
- ArgumentType any ,
514
- ObjectType rbac.Objecter ,
515
- DatabaseFunc func (ctx context.Context ,arg ArgumentType ) ([]ObjectType ,error ),
513
+ ArgumentType any ,
514
+ ObjectType rbac.Objecter ,
515
+ DatabaseFunc func (ctx context.Context ,arg ArgumentType ) ([]ObjectType ,error ),
516
516
](
517
517
authorizer rbac.Authorizer ,
518
518
action policy.Action ,