@@ -18,6 +18,10 @@ enum RequiredPermissionType {
18
18
19
19
/// Requires the user to have a specific permission string.
20
20
specificPermission,
21
+
22
+ /// This action is not supported via this generic route.
23
+ /// It is typically handled by a dedicated service or route.
24
+ unsupported,
21
25
}
22
26
23
27
/// Configuration for the authorization requirements of a single HTTP method
@@ -196,17 +200,15 @@ final modelRegistry = <String, ModelConfig<dynamic>>{
196
200
requiresOwnershipCheck: true , // Must be the owner
197
201
),
198
202
postPermission: const ModelActionPermission (
199
- type: RequiredPermissionType .none , // User creation handled by auth routes
203
+ type: RequiredPermissionType .unsupported , // User creation handled by auth routes
200
204
),
201
205
putPermission: const ModelActionPermission (
202
206
type: RequiredPermissionType .specificPermission,
203
207
permission: Permissions .userUpdateOwned, // User can update their own
204
208
requiresOwnershipCheck: true , // Must be the owner
205
209
),
206
210
deletePermission: const ModelActionPermission (
207
- type: RequiredPermissionType .specificPermission,
208
- permission: Permissions .userDeleteOwned, // User can delete their own
209
- requiresOwnershipCheck: true , // Must be the owner
211
+ type: RequiredPermissionType .unsupported, // User can delete their own
210
212
),
211
213
),
212
214
// Configuration for UserAppSettings (user-owned)
@@ -220,7 +222,7 @@ final modelRegistry = <String, ModelConfig<dynamic>>{
220
222
requiresOwnershipCheck: true ,
221
223
),
222
224
postPermission: const ModelActionPermission (
223
- type: RequiredPermissionType .none ,
225
+ type: RequiredPermissionType .unsupported ,
224
226
// Creation of UserAppSettings is handled by the authentication service
225
227
// during user creation, not via a direct POST to /api/v1/data.
226
228
),
@@ -230,7 +232,7 @@ final modelRegistry = <String, ModelConfig<dynamic>>{
230
232
requiresOwnershipCheck: true ,
231
233
),
232
234
deletePermission: const ModelActionPermission (
233
- type: RequiredPermissionType .none ,
235
+ type: RequiredPermissionType .unsupported ,
234
236
// Deletion of UserAppSettings is handled by the authentication service
235
237
// during account deletion, not via a direct DELETE to /api/v1/data.
236
238
),
@@ -246,7 +248,7 @@ final modelRegistry = <String, ModelConfig<dynamic>>{
246
248
requiresOwnershipCheck: true ,
247
249
),
248
250
postPermission: const ModelActionPermission (
249
- type: RequiredPermissionType .none ,
251
+ type: RequiredPermissionType .unsupported ,
250
252
// Creation of UserContentPreferences is handled by the authentication
251
253
// service during user creation, not via a direct POST to /api/v1/data.
252
254
),
@@ -256,7 +258,7 @@ final modelRegistry = <String, ModelConfig<dynamic>>{
256
258
requiresOwnershipCheck: true ,
257
259
),
258
260
deletePermission: const ModelActionPermission (
259
- type: RequiredPermissionType .none ,
261
+ type: RequiredPermissionType .unsupported ,
260
262
// Deletion of UserContentPreferences is handled by the authentication
261
263
// service during account deletion, not via a direct DELETE to /api/v1/data.
262
264
),
0 commit comments