Skip to content

Commit 451befc

Browse files
committed
fix(registry): update PushNotificationDevice collection permission
- Change collection permission from 'unsupported' to 'adminOnly' - This update is necessary for the ownership check middleware used by deletePermission - Ensure that only admins can perform collection-level operations on PushNotificationDevice
1 parent 9cdf1fb commit 451befc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/src/registry/model_registry.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,9 @@ final modelRegistry = <String, ModelConfig<dynamic>>{
429429
fromJson: PushNotificationDevice.fromJson,
430430
getId: (d) => d.id,
431431
getOwnerId: (dynamic item) => (item as PushNotificationDevice).userId,
432-
// Collection GET is not supported for this model as there is no use case
433-
// for a client to list all device registrations.
432+
// Required by the ownership check middelware used by the deletePermission.
434433
getCollectionPermission: const ModelActionPermission(
435-
type: RequiredPermissionType.unsupported,
434+
type: RequiredPermissionType.adminOnly,
436435
),
437436
// Item GET is not supported for this model. A client registers a device
438437
// and then forgets about it until it needs to be deleted.

0 commit comments

Comments
 (0)