mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 00:02:54 -04:00
Merge pull request #53466 from nextcloud/feature/hide-external-shares-excluded-groups
feat(files_sharing): Hide link shares for users in excluded groups
This commit is contained in:
commit
768898e28f
10 changed files with 30 additions and 9 deletions
|
|
@ -100,7 +100,7 @@
|
|||
:file-info="fileInfo"
|
||||
@open-sharing-details="toggleShareDetailsView" />
|
||||
<!-- link shares list -->
|
||||
<SharingLinkList v-if="!loading"
|
||||
<SharingLinkList v-if="!loading && isLinkSharingAllowed"
|
||||
ref="linkShareList"
|
||||
:can-reshare="canReshare"
|
||||
:file-info="fileInfo"
|
||||
|
|
@ -157,6 +157,7 @@
|
|||
|
||||
<script>
|
||||
import { getCurrentUser } from '@nextcloud/auth'
|
||||
import { getCapabilities } from '@nextcloud/capabilities'
|
||||
import { orderBy } from '@nextcloud/files'
|
||||
import { loadState } from '@nextcloud/initial-state'
|
||||
import { generateOcsUrl } from '@nextcloud/router'
|
||||
|
|
@ -242,7 +243,24 @@ export default {
|
|||
* @return {boolean}
|
||||
*/
|
||||
isSharedWithMe() {
|
||||
return Object.keys(this.sharedWithMe).length > 0
|
||||
return this.sharedWithMe !== null
|
||||
&& this.sharedWithMe !== undefined
|
||||
},
|
||||
|
||||
/**
|
||||
* Is link sharing allowed for the current user?
|
||||
*
|
||||
* @return {boolean}
|
||||
*/
|
||||
isLinkSharingAllowed() {
|
||||
const currentUser = getCurrentUser()
|
||||
if (!currentUser) {
|
||||
return false
|
||||
}
|
||||
|
||||
const capabilities = getCapabilities()
|
||||
const publicSharing = capabilities.files_sharing?.public || {}
|
||||
return publicSharing.enabled === true
|
||||
},
|
||||
|
||||
canReshare() {
|
||||
|
|
@ -257,6 +275,9 @@ export default {
|
|||
},
|
||||
|
||||
externalShareInputPlaceholder() {
|
||||
if (!this.isLinkSharingAllowed) {
|
||||
return t('files_sharing', 'Federated cloud ID')
|
||||
}
|
||||
return this.config.showFederatedSharesAsInternal
|
||||
? t('files_sharing', 'Email')
|
||||
: t('files_sharing', 'Email, federated cloud ID')
|
||||
|
|
|
|||
2
dist/2044-2044.js
vendored
2
dist/2044-2044.js
vendored
File diff suppressed because one or more lines are too long
1
dist/2044-2044.js.map
vendored
1
dist/2044-2044.js.map
vendored
File diff suppressed because one or more lines are too long
1
dist/2044-2044.js.map.license
vendored
1
dist/2044-2044.js.map.license
vendored
|
|
@ -1 +0,0 @@
|
|||
2044-2044.js.license
|
||||
2
dist/7701-7701.js
vendored
Normal file
2
dist/7701-7701.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/7701-7701.js.map
vendored
Normal file
1
dist/7701-7701.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/7701-7701.js.map.license
vendored
Symbolic link
1
dist/7701-7701.js.map.license
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
7701-7701.js.license
|
||||
4
dist/files_sharing-files_sharing_tab.js
vendored
4
dist/files_sharing-files_sharing_tab.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_sharing-files_sharing_tab.js.map
vendored
2
dist/files_sharing-files_sharing_tab.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue