100100 :file-info =" fileInfo"
101101 @open-sharing-details =" toggleShareDetailsView" />
102102 <!-- link shares list -->
103- <SharingLinkList v-if =" !loading"
103+ <SharingLinkList v-if =" !loading && isLinkSharingAllowed "
104104 ref =" linkShareList"
105105 :can-reshare =" canReshare"
106106 :file-info =" fileInfo"
157157
158158<script >
159159import { getCurrentUser } from ' @nextcloud/auth'
160+ import { getCapabilities } from ' @nextcloud/capabilities'
160161import { orderBy } from ' @nextcloud/files'
161162import { loadState } from ' @nextcloud/initial-state'
162163import { generateOcsUrl } from ' @nextcloud/router'
@@ -242,7 +243,25 @@ export default {
242243 * @return {boolean}
243244 */
244245 isSharedWithMe () {
245- return Object .keys (this .sharedWithMe ).length > 0
246+ return this .sharedWithMe !== null
247+ && this .sharedWithMe !== undefined
248+ },
249+
250+ /**
251+ * Is link sharing allowed for the current user?
252+ * This checks if the user is in a group that is excluded from link sharing
253+ *
254+ * @return {boolean}
255+ */
256+ isLinkSharingAllowed () {
257+ const currentUser = getCurrentUser ()
258+ if (! currentUser) {
259+ return false
260+ }
261+
262+ const capabilities = getCapabilities ()
263+ const publicSharing = capabilities .files_sharing ? .public || {}
264+ return publicSharing .enabled === true
246265 },
247266
248267 canReshare () {
@@ -264,6 +283,10 @@ export default {
264283 },
265284
266285 methods: {
286+ /**
287+ * Fetch the current user's groups
288+ */
289+
267290 /**
268291 * Update current fileInfo and fetch new data
269292 *
0 commit comments