From 3d6346ff3b72df7e69b897d11c0c32b4c985477e Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Fri, 22 Jul 2022 13:43:23 +0200 Subject: [PATCH] Prevent share permissions from being exceeded --- changelog/unreleased/enhancement-ocis-resharing | 1 + .../components/SideBar/Shares/Collaborators/RoleDropdown.vue | 4 ++-- .../web-app-files/src/components/SideBar/Shares/FileLinks.vue | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/changelog/unreleased/enhancement-ocis-resharing b/changelog/unreleased/enhancement-ocis-resharing index c8a74974d1f..838385215a9 100644 --- a/changelog/unreleased/enhancement-ocis-resharing +++ b/changelog/unreleased/enhancement-ocis-resharing @@ -7,4 +7,5 @@ https://github.com/owncloud/web/pull/7086 https://github.com/owncloud/web/pull/7247 https://github.com/owncloud/web/issues/6894 https://github.com/owncloud/web/pull/7243 +https://github.com/owncloud/web/pull/7317 https://github.com/owncloud/web/issues/7225 diff --git a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/RoleDropdown.vue b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/RoleDropdown.vue index cc6c09316e5..530e0913d91 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/RoleDropdown.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/RoleDropdown.vue @@ -167,7 +167,7 @@ export default { return SpacePeopleShareRoles.list() } - if (this.resource.isReceivedShare() && this.resourceIsSharable && this.share) { + if (this.share?.incoming && this.resourceIsSharable) { return PeopleShareRoles.filterByBitmask( parseInt(this.share.permissions), this.resource.isFolder, @@ -179,7 +179,7 @@ export default { return PeopleShareRoles.list(this.resource.isFolder, this.allowCustomSharing !== false) }, availablePermissions() { - if (this.resource.isReceivedShare() && this.resourceIsSharable && this.share) { + if (this.share?.incoming && this.resourceIsSharable) { return SharePermissions.bitmaskToPermissions(parseInt(this.share.permissions)) } return this.customPermissionsRole.permissions(this.allowSharePermission) diff --git a/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue b/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue index 408ad587e76..8b3fd737ef8 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue @@ -219,7 +219,7 @@ export default defineComponent({ }, availableRoleOptions() { - if (this.highlightedFile.isReceivedShare() && this.canCreatePublicLinks && this.share) { + if (this.share?.incoming && this.canCreatePublicLinks) { return LinkShareRoles.filterByBitmask( parseInt(this.share.permissions), this.highlightedFile.isFolder,