Skip to content

Commit

Permalink
fix(files): "Edit locally" action should not be shown on public shares
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Sep 6, 2024
1 parent 018af2a commit be884ee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/files/src/actions/editLocallyAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import axios from '@nextcloud/axios'
import LaptopSvg from '@mdi/svg/svg/laptop.svg?raw'
import IconCancel from '@mdi/svg/svg/cancel.svg?raw'
import IconCheck from '@mdi/svg/svg/check.svg?raw'
import { isPublicShare } from '@nextcloud/sharing/public'

const confirmLocalEditDialog = (
localEditCallback: (openingLocally: boolean) => void = () => {},
Expand Down Expand Up @@ -90,6 +91,11 @@ export const action = new FileAction({
return false
}

// does not work with shares
if (isPublicShare()) {
return false
}

return (nodes[0].permissions & Permission.UPDATE) !== 0
},

Expand Down

0 comments on commit be884ee

Please sign in to comment.