Skip to content

Commit

Permalink
Merge pull request #11055 from nextcloud/backport/11052/stable-3.23
Browse files Browse the repository at this point in the history
[stable-3.23] prohibit share of an encrypted folder
  • Loading branch information
AlvaroBrey authored Nov 17, 2022
2 parents 0520091 + 3bd45d5 commit 0822103
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/src/main/java/com/owncloud/android/files/FileMenuFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ private void filterUnlock(List<Integer> toHide, boolean fileLockingEnabled) {

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);
}
}
Expand Down Expand Up @@ -547,4 +547,13 @@ private boolean allNotFavorites() {
}
return true;
}

private boolean isShared() {
for (OCFile file : files) {
if (file.isSharedWithMe() || file.isSharedViaLink() || file.isSharedWithSharee()) {
return true;
}
}
return false;
}
}

0 comments on commit 0822103

Please sign in to comment.