diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2021-04-19 16:10:51 +0300 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2021-04-19 16:10:51 +0300 |
commit | 68dadc01af263435331e080589723787c2376f8a (patch) | |
tree | a36c48c8500790ae984031ade0de254f4514d8b6 /apps/files_sharing/src/components/SharingEntry.vue | |
parent | 9a69b8839389f133db55a41e1c2ba4435fd50c19 (diff) |
Consider read permission in sharing tab
When updating a share we should make sure to use all the old permissions
(and only change what we actually changed). So the READ permission in
this case should also be fetched instead of always granted.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files_sharing/src/components/SharingEntry.vue')
-rw-r--r-- | apps/files_sharing/src/components/SharingEntry.vue | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue index e07654a19c1..8167172ceea 100644 --- a/apps/files_sharing/src/components/SharingEntry.vue +++ b/apps/files_sharing/src/components/SharingEntry.vue @@ -327,6 +327,16 @@ export default { }, /** + * Is this share readable + * Needed for some federated shares that might have been added from file drop links + */ + hasRead: { + get() { + return this.share.hasReadPermission + }, + }, + + /** * Is the current share a folder ? * @returns {boolean} */ @@ -377,7 +387,8 @@ export default { methods: { updatePermissions({ isEditChecked = this.canEdit, isCreateChecked = this.canCreate, isDeleteChecked = this.canDelete, isReshareChecked = this.canReshare } = {}) { // calc permissions if checked - const permissions = this.permissionsRead + const permissions = 0 + | (this.hasRead ? this.permissionsRead : 0) | (isCreateChecked ? this.permissionsCreate : 0) | (isDeleteChecked ? this.permissionsDelete : 0) | (isEditChecked ? this.permissionsEdit : 0) |