@@ -7,9 +7,10 @@ import type { IFileAction } from '@nextcloud/files'
77
88import AutoRenewSvg from '@mdi/svg/svg/autorenew.svg?raw'
99import { getCapabilities } from '@nextcloud/capabilities'
10- import { registerFileAction } from '@nextcloud/files'
10+ import { Permission , registerFileAction } from '@nextcloud/files'
1111import { t } from '@nextcloud/l10n'
1212import { generateUrl } from '@nextcloud/router'
13+ import { isPublicShare } from '@nextcloud/sharing/public'
1314import { convertFile , convertFiles } from './convertUtils.ts'
1415
1516type ConversionsProvider = {
@@ -30,7 +31,11 @@ export function registerConvertActions() {
3031 id : `convert-${ from } -${ to } ` ,
3132 displayName : ( ) => t ( 'files' , 'Save as {displayName}' , { displayName } ) ,
3233 iconSvgInline : ( ) => generateIconSvg ( to ) ,
33- enabled : ( { nodes } ) => {
34+ enabled : ( { nodes, folder } ) => {
35+ if ( isPublicShare ( ) && ! ( folder . permissions & Permission . CREATE ) ) {
36+ // cannot create the converted file in a public share if we don't have create permissions
37+ return false
38+ }
3439 // Check that all nodes have the same mime type
3540 return nodes . every ( ( node ) => from === node . mime )
3641 } ,
0 commit comments