Nc album shared with you is not allowed to be renamed

This commit is contained in:
Ming Ming 2023-09-09 23:40:07 +08:00
parent 423ab9ebb1
commit 51b9d26e31
2 changed files with 15 additions and 2 deletions

View file

@ -150,8 +150,16 @@ class CollectionNcAlbumAdapter
Future<void> remove() => RemoveNcAlbum(_c)(account, _provider.album);
@override
bool isPermitted(CollectionCapability capability) =>
_provider.capabilities.contains(capability);
bool isPermitted(CollectionCapability capability) {
if (!_provider.capabilities.contains(capability)) {
return false;
}
if (_provider.isOwned) {
return true;
} else {
return _provider.guestCapabilities.contains(capability);
}
}
@override
bool isManualCover() => false;

View file

@ -44,6 +44,11 @@ class CollectionNcAlbumProvider
// CollectionCapability.share,
];
/// Capabilities when this album is shared to this user by someone else
List<CollectionCapability> get guestCapabilities => [
CollectionCapability.manualItem,
];
@override
CollectionItemSort get itemSort => CollectionItemSort.dateDescending;