@@ -62,7 +62,6 @@ func authorizedInsert[ArgumentType any,
62
62
action rbac.Action ,
63
63
object rbac.Objecter ,
64
64
insertFunc Insert ) Insert {
65
-
66
65
return func (ctx context.Context , arg ArgumentType ) error {
67
66
_ , err := authorizedInsertWithReturn (logger , authorizer , action , object , func (ctx context.Context , arg ArgumentType ) (rbac.Objecter , error ) {
68
67
return rbac.Object {}, insertFunc (ctx , arg )
@@ -79,7 +78,6 @@ func authorizedInsertWithReturn[ObjectType any, ArgumentType any,
79
78
action rbac.Action ,
80
79
object rbac.Objecter ,
81
80
insertFunc Insert ) Insert {
82
-
83
81
return func (ctx context.Context , arg ArgumentType ) (empty ObjectType , err error ) {
84
82
// Fetch the rbac subject
85
83
act , ok := ActorFromContext (ctx )
@@ -106,7 +104,6 @@ func authorizedDelete[ObjectType rbac.Objecter, ArgumentType any,
106
104
authorizer rbac.Authorizer ,
107
105
fetchFunc Fetch ,
108
106
deleteFunc Delete ) Delete {
109
-
110
107
return authorizedFetchAndExec (logger , authorizer ,
111
108
rbac .ActionDelete , fetchFunc , deleteFunc )
112
109
}
@@ -120,7 +117,6 @@ func authorizedUpdateWithReturn[ObjectType rbac.Objecter,
120
117
authorizer rbac.Authorizer ,
121
118
fetchFunc Fetch ,
122
119
updateQuery UpdateQuery ) UpdateQuery {
123
-
124
120
return authorizedFetchAndQuery (logger , authorizer , rbac .ActionUpdate , fetchFunc , updateQuery )
125
121
}
126
122
@@ -133,7 +129,6 @@ func authorizedUpdate[ObjectType rbac.Objecter,
133
129
authorizer rbac.Authorizer ,
134
130
fetchFunc Fetch ,
135
131
updateExec Exec ) Exec {
136
-
137
132
return authorizedFetchAndExec (logger , authorizer , rbac .ActionUpdate , fetchFunc , updateExec )
138
133
}
139
134
@@ -150,7 +145,6 @@ func authorizedFetchAndExec[ObjectType rbac.Objecter,
150
145
action rbac.Action ,
151
146
fetchFunc Fetch ,
152
147
execFunc Exec ) Exec {
153
-
154
148
f := authorizedFetchAndQuery (logger , authorizer , action , fetchFunc , func (ctx context.Context , arg ArgumentType ) (empty ObjectType , err error ) {
155
149
return empty , execFunc (ctx , arg )
156
150
})
@@ -169,7 +163,6 @@ func authorizedFetchAndQuery[ObjectType rbac.Objecter, ArgumentType any,
169
163
action rbac.Action ,
170
164
fetchFunc Fetch ,
171
165
queryFunc Query ) Query {
172
-
173
166
return func (ctx context.Context , arg ArgumentType ) (empty ObjectType , err error ) {
174
167
// Fetch the rbac subject
175
168
act , ok := ActorFromContext (ctx )
@@ -199,7 +192,6 @@ func authorizedFetch[ObjectType rbac.Objecter, ArgumentType any,
199
192
logger slog.Logger ,
200
193
authorizer rbac.Authorizer ,
201
194
fetchFunc Fetch ) Fetch {
202
-
203
195
return authorizedQuery (logger , authorizer , rbac .ActionRead , fetchFunc )
204
196
}
205
197
@@ -220,7 +212,6 @@ func authorizedQuery[ArgumentType any, ObjectType rbac.Objecter,
220
212
authorizer rbac.Authorizer ,
221
213
action rbac.Action ,
222
214
f DatabaseFunc ) DatabaseFunc {
223
-
224
215
return func (ctx context.Context , arg ArgumentType ) (empty ObjectType , err error ) {
225
216
// Fetch the rbac subject
226
217
act , ok := ActorFromContext (ctx )
@@ -251,7 +242,6 @@ func authorizedFetchSet[ArgumentType any, ObjectType rbac.Objecter,
251
242
// Arguments
252
243
authorizer rbac.Authorizer ,
253
244
f DatabaseFunc ) DatabaseFunc {
254
-
255
245
return func (ctx context.Context , arg ArgumentType ) (empty []ObjectType , err error ) {
256
246
// Fetch the rbac subject
257
247
act , ok := ActorFromContext (ctx )
@@ -283,7 +273,6 @@ func authorizedQueryWithRelated[ObjectType any, ArgumentType any, Related rbac.O
283
273
action rbac.Action ,
284
274
relatedFunc func (ObjectType , ArgumentType ) (Related , error ),
285
275
fetch func (ctx context.Context , arg ArgumentType ) (ObjectType , error )) func (ctx context.Context , arg ArgumentType ) (ObjectType , error ) {
286
-
287
276
return func (ctx context.Context , arg ArgumentType ) (empty ObjectType , err error ) {
288
277
// Fetch the rbac subject
289
278
act , ok := ActorFromContext (ctx )
0 commit comments