aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-09-04 18:31:17 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-09-06 03:38:47 +0200
commit3134053497105509cf495cde37a3f4f1d19cb1ac (patch)
tree411047615025cc29725bdefc67f9e82cecc4d288 /apps
parent1d16bc47ffe7fbbf3f98a773612df6cdfa56f7de (diff)
downloadnextcloud-server-3134053497105509cf495cde37a3f4f1d19cb1ac.tar.gz
nextcloud-server-3134053497105509cf495cde37a3f4f1d19cb1ac.zip
fix(files_sharing): Disable sharing status action for public shares
This is disabled to not leak personal information into the public Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/src/files_actions/sharingStatusAction.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files_sharing/src/files_actions/sharingStatusAction.ts b/apps/files_sharing/src/files_actions/sharingStatusAction.ts
index 635e9e0d572..bd9448689a2 100644
--- a/apps/files_sharing/src/files_actions/sharingStatusAction.ts
+++ b/apps/files_sharing/src/files_actions/sharingStatusAction.ts
@@ -2,16 +2,17 @@
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
+import { getCurrentUser } from '@nextcloud/auth'
import { Node, View, registerFileAction, FileAction, Permission } from '@nextcloud/files'
import { translate as t } from '@nextcloud/l10n'
import { ShareType } from '@nextcloud/sharing'
+import { isPublicShare } from '@nextcloud/sharing/public'
import AccountGroupSvg from '@mdi/svg/svg/account-group.svg?raw'
import AccountPlusSvg from '@mdi/svg/svg/account-plus.svg?raw'
import LinkSvg from '@mdi/svg/svg/link.svg?raw'
import CircleSvg from '../../../../core/img/apps/circles.svg?raw'
-import { getCurrentUser } from '@nextcloud/auth'
import { action as sidebarAction } from '../../../files/src/actions/sidebarAction'
import { generateAvatarSvg } from '../utils/AccountIcon'
@@ -103,6 +104,11 @@ export const action = new FileAction({
return false
}
+ // Do not leak information about users to public shares
+ if (isPublicShare()) {
+ return false
+ }
+
const node = nodes[0]
const shareTypes = node.attributes?.['share-types']
const isMixed = Array.isArray(shareTypes) && shareTypes.length > 0