mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 02:17:43 +03:00
Set appropiate permissions for the federated shares for the operation request
This commit is contained in:
parent
f60aa06c2d
commit
f2d05a3554
2 changed files with 7 additions and 5 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 1007a80534827479b0874ae942c8c7dbe87cac35
|
||||
Subproject commit 23643ad28e3ef52c6f3bcd8bc56ce18ccfed4ba5
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue