diff --git a/lib/services/collections_service.dart b/lib/services/collections_service.dart index 5cceece1b..ae8ae150f 100644 --- a/lib/services/collections_service.dart +++ b/lib/services/collections_service.dart @@ -1443,9 +1443,19 @@ class CollectionsService { int fromCollectionID, List files, ) { + final int userID = Configuration.instance.getUserID()!; if (toCollectionID == fromCollectionID) { throw AssertionError("Can't move to same album"); } + final Collection? toCollection = _collectionIDToCollections[toCollectionID]; + final Collection? fromCollection = + _collectionIDToCollections[fromCollectionID]; + if (toCollection != null && !toCollection.isOwner(userID)) { + throw AssertionError("Can't move to a collection you don't own"); + } + if (fromCollection != null && !fromCollection.isOwner(userID)) { + throw AssertionError("Can't move from a collection you don't own"); + } for (final file in files) { if (file.uploadedFileID == null) { throw AssertionError("Can only move uploaded memories");