[mob] Add assertion check

This commit is contained in:
Neeraj Gupta 2024-04-19 09:18:55 +05:30
parent 420cec01d2
commit b8ad320931

View file

@ -1170,6 +1170,13 @@ class CollectionsService {
_logger.info("nothing to add to the collection");
return;
}
final anyFileOwnedByOther =
files.any((e) => e.ownerID != null && e.ownerID != _config.getUserID());
if (anyFileOwnedByOther) {
throw ArgumentError(
'Cannot add files owned by other users, they should be copied',
);
}
final params = <String, dynamic>{};
params["collectionID"] = collectionID;