Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/file-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { registerFileAction } from '@nextcloud/files'
import { Permission, registerFileAction } from '@nextcloud/files'
import { getCapabilities } from './services/capabilities.ts'
import { translate as t } from '@nextcloud/l10n'

Expand All @@ -28,6 +28,10 @@ const openPdf = {
return false
}

if ((nodes[0].permissions & Permission.READ) === 0) {
return false
}

const isPdf = nodes[0].mime === 'application/pdf'
// Only enable the file action when files_pdfviewer is enabled
const optionalMimetypes = getCapabilities().mimetypesNoDefaultOpen
Expand Down
Loading