Browse Source

Set appropiate permissions for the federated shares for the operation request

Juan Carlos González Cabrero 9 years ago
parent
commit
f2d05a3554

+ 1 - 1
owncloud-android-library

@@ -1 +1 @@
-Subproject commit 1007a80534827479b0874ae942c8c7dbe87cac35
+Subproject commit 23643ad28e3ef52c6f3bcd8bc56ce18ccfed4ba5

+ 6 - 4
src/com/owncloud/android/ui/activity/ShareActivity.java

@@ -136,20 +136,22 @@ public class ShareActivity extends FileActivity
                 getFile(),
                 shareeName,
                 shareType,
-                getAppropiatePermissions()
+                getAppropiatePermissions(shareType.equals(ShareType.FEDERATED))
         );
     }
 
 
-    private int getAppropiatePermissions() {
+    private int getAppropiatePermissions(boolean isFederated) {
         if (getFile().isSharedWithMe()) {
             return OCShare.READ_PERMISSION_FLAG;    // minimum permissions
 
         } else if (getFile().isFolder()) {
-            return OCShare.MAXIMUM_PERMISSIONS_FOR_FOLDER;
+            // check if the Share is FERERATED
+            return (isFederated) ? OCShare.FEDERATED_PERMISSIONS_FOR_FOLDER : OCShare.MAXIMUM_PERMISSIONS_FOR_FOLDER;
 
         } else {    // isFile
-            return OCShare.MAXIMUM_PERMISSIONS_FOR_FILE;
+            // check if the Share is FERERATED
+            return (isFederated) ? OCShare.FEDERATED_PERMISSIONS_FOR_FILE : OCShare.MAXIMUM_PERMISSIONS_FOR_FILE;
         }
     }