fix: add missing permission checks to file routes and map context menu

- Add checkPermission to 6 unprotected file endpoints (star, restore,
  permanent delete, empty trash, link, unlink)
- Gate map right-click place creation with place_edit permission
- Use file_upload permission for collab note file uploads
This commit is contained in:
Gérnyi Márk
2026-03-31 23:45:11 +02:00
parent 23edfe3dfc
commit 1fbc19ad4f
3 changed files with 15 additions and 2 deletions

View File

@@ -169,6 +169,7 @@ export default function TripPlannerPage(): React.ReactElement | null {
}, [])
const handleMapContextMenu = useCallback(async (e) => {
if (!can('place_edit', trip)) return
e.originalEvent?.preventDefault()
const { lat, lng } = e.latlng
setPrefillCoords({ lat, lng })