fix(files): "Edit locally" action should not be shown on public shares

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/45652/head
Ferdinand Thiessen 3 months ago
parent 018af2a2fe
commit be884eeaec
No known key found for this signature in database
GPG Key ID: 45FAE7268762B400
  1. 6
      apps/files/src/actions/editLocallyAction.ts

@ -12,6 +12,7 @@ import axios from '@nextcloud/axios'
import LaptopSvg from '@mdi/svg/svg/laptop.svg?raw' import LaptopSvg from '@mdi/svg/svg/laptop.svg?raw'
import IconCancel from '@mdi/svg/svg/cancel.svg?raw' import IconCancel from '@mdi/svg/svg/cancel.svg?raw'
import IconCheck from '@mdi/svg/svg/check.svg?raw' import IconCheck from '@mdi/svg/svg/check.svg?raw'
import { isPublicShare } from '@nextcloud/sharing/public'
const confirmLocalEditDialog = ( const confirmLocalEditDialog = (
localEditCallback: (openingLocally: boolean) => void = () => {}, localEditCallback: (openingLocally: boolean) => void = () => {},
@ -90,6 +91,11 @@ export const action = new FileAction({
return false return false
} }
// does not work with shares
if (isPublicShare()) {
return false
}
return (nodes[0].permissions & Permission.UPDATE) !== 0 return (nodes[0].permissions & Permission.UPDATE) !== 0
}, },

Loading…
Cancel
Save