mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 00:20:07 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user