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 68b33532c09..80dd9ebbfff 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 @@ -172,8 +172,6 @@ export default { return SpacePeopleShareRoles.list() } - console.log(this.share) - if (this.resource.isReceivedShare() && this.resourceIsSharable && this.share) { return PeopleShareRoles.filterByBitmask( parseInt(this.share.permissions), 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 10403c7eed4..8a36a43e667 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue @@ -121,6 +121,7 @@ import { showQuickLinkPasswordModal } from '../../../quickActions' import DetailsAndEdit from './Links/DetailsAndEdit.vue' import NameAndCopy from './Links/NameAndCopy.vue' import CreateQuickLink from './Links/CreateQuickLink.vue' +import { isLocationSpacesActive } from '../../../router' export default defineComponent({ name: 'FileLinks', @@ -244,6 +245,14 @@ export default defineComponent({ }, canCreatePublicLinks() { + const reSharingEnabled = this.capabilities?.files_sharing?.resharing === true + if (this.highlightedFile.isReceivedShare() && !reSharingEnabled) { + return false + } + const isShareJail = isLocationSpacesActive(this.$router, 'files-spaces-share') + if (isShareJail && !reSharingEnabled) { + return false + } return this.highlightedFile.canShare({ user: this.user }) }, diff --git a/packages/web-app-files/src/components/SideBar/Shares/FileShares.vue b/packages/web-app-files/src/components/SideBar/Shares/FileShares.vue index 94bfc7eba8b..60e155dacf2 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/FileShares.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/FileShares.vue @@ -151,6 +151,7 @@ export default { } }, computed: { + ...mapGetters(['capabilities']), ...mapGetters('Files', ['highlightedFile', 'currentFileOutgoingCollaborators']), ...mapState('Files', ['incomingShares', 'sharesTree']), ...mapState(['user']), @@ -261,6 +262,15 @@ export default { }, currentUserCanShare() { + const reSharingEnabled = this.capabilities?.files_sharing?.resharing === true + if (this.highlightedFile.isReceivedShare() && !reSharingEnabled) { + return false + } + const isShareJail = isLocationSpacesActive(this.$router, 'files-spaces-share') + if (isShareJail && !reSharingEnabled) { + return false + } + return this.highlightedFile.canShare({ user: this.user }) }, noResharePermsMessage() {