fix(collections): moving a place out of a list needs the same role as deleting it

Moving a saved place to another list takes it out of the source list, but
updatePlace only asked for edit rights there, so an editor could empty a
shared list they may not delete from. The source now takes owner or admin,
like a delete, and the target still takes edit rights. REST and the
update_collection_place tool share the service path. The Move to list
action on desktop and phone follows the delete permission.
This commit is contained in:
Maurice
2026-10-12 09:17:02 +02:00
parent 6c8321cd63
commit aa1bb41cf5
11 changed files with 172 additions and 7 deletions
@@ -435,6 +435,16 @@ describe('MCollections', () => {
expect(screen.getByRole('button', { name: /collections.duplicateToList/ })).toBeInTheDocument()
})
it('FE-MOB-COLSCR-017b: an editor keeps copy and duplicate but cannot move places out of the list', () => {
mocks.coll = makeHook({ selectMode: true, selectedIds: [10], canEdit: true, canDelete: false, isOwner: false })
render(<MCollections />)
expect(screen.queryByRole('button', { name: /collections.moveToList/ })).not.toBeInTheDocument()
expect(screen.queryByRole('button', { name: /common.delete/ })).not.toBeInTheDocument()
expect(screen.getByRole('button', { name: /collections.duplicateToList/ })).toBeInTheDocument()
expect(screen.getByRole('button', { name: /collections.copyToTrip/ })).toBeInTheDocument()
})
it('FE-MOB-COLSCR-018: the list view renders rows, the loading state and both empty states', () => {
render(<MCollections />)
expect(screen.getByText('Elbphilharmonie')).toBeInTheDocument()