From 3134053497105509cf495cde37a3f4f1d19cb1ac Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 4 Sep 2024 18:31:17 +0200 Subject: 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 --- apps/files_sharing/src/files_actions/sharingStatusAction.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'apps') 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 -- cgit v1.2.3