From bc353af37e6e3bafaf24f7d98c5c5ab1412726fa Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Tue, 19 Apr 2016 16:43:34 +0200 Subject: [PATCH] Send update of share permissions in reshared remote shares --- .../ui/fragment/EditShareFragment.java | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/com/owncloud/android/ui/fragment/EditShareFragment.java b/src/com/owncloud/android/ui/fragment/EditShareFragment.java index 67b9ae223f..042dd677bc 100644 --- a/src/com/owncloud/android/ui/fragment/EditShareFragment.java +++ b/src/com/owncloud/android/ui/fragment/EditShareFragment.java @@ -256,16 +256,25 @@ public class EditShareFragment extends Fragment { boolean isFederated = ShareType.FEDERATED.equals(mShare.getShareType()); if (mFile.isFolder()) { if (isChecked) { - for (int i = 0; i < sSubordinateCheckBoxIds.length; i++) { - //noinspection ConstantConditions, prevented in the method beginning - subordinate = (CompoundButton) getView().findViewById(sSubordinateCheckBoxIds[i]); - if (!isFederated) { + if (!isFederated) { + /// not federated shares -> enable all the subpermisions + for (int i = 0; i < sSubordinateCheckBoxIds.length; i++) { + //noinspection ConstantConditions, prevented in the method beginning + subordinate = (CompoundButton) getView().findViewById(sSubordinateCheckBoxIds[i]); subordinate.setVisibility(View.VISIBLE); - } - if (!subordinate.isChecked() && + if (!subordinate.isChecked() && !mFile.isSharedWithMe()) { // see (1) + toggleDisablingListener(subordinate); + } + } + } else { + /// federated share -> enable delete subpermission, as server side; TODO why? + //noinspection ConstantConditions, prevented in the method beginning + subordinate = (CompoundButton) getView().findViewById(R.id.canEditDeleteCheckBox); + if (!subordinate.isChecked()) { toggleDisablingListener(subordinate); } + } } else { for (int i = 0; i < sSubordinateCheckBoxIds.length; i++) { @@ -279,7 +288,8 @@ public class EditShareFragment extends Fragment { } } - if(!(mFile.isFolder() && isChecked && mFile.isSharedWithMe())) { // see (1) + if(!(mFile.isFolder() && isChecked && mFile.isSharedWithMe()) // see (1) + || isFederated ) { updatePermissionsToShare(); }