Set appropiate permissions for the federated shares for the operation request

This commit is contained in:
Juan Carlos González Cabrero 2016-03-01 13:27:24 +01:00 committed by David A. Velasco
parent f60aa06c2d
commit f2d05a3554
2 changed files with 7 additions and 5 deletions

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

View file

@ -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;
}
}