[mob] Add assertion check
This commit is contained in:
parent
420cec01d2
commit
b8ad320931
1 changed files with 7 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue