Merge pull request #11052 from nextcloud/doNotAllowSharedEncryptedFolder

prohibit share of an encrypted folder
This commit is contained in:
Álvaro Brey 2022-11-17 14:47:23 +01:00 committed by GitHub
commit ab13b9873c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -244,7 +244,7 @@ public class FileMenuFilter {
private void filterEncrypt(List<Integer> toHide, boolean endToEndEncryptionEnabled) {
if (files.isEmpty() || !isSingleSelection() || isSingleFile() || isEncryptedFolder() || isGroupFolder()
|| !endToEndEncryptionEnabled || !isEmptyFolder()) {
|| !endToEndEncryptionEnabled || !isEmptyFolder() || isShared()) {
toHide.add(R.id.action_encrypted);
}
}
@ -547,4 +547,13 @@ public class FileMenuFilter {
}
return true;
}
private boolean isShared() {
for (OCFile file : files) {
if (file.isSharedWithMe() || file.isSharedViaLink() || file.isSharedWithSharee()) {
return true;
}
}
return false;
}
}