Review main Ready for review

95173[BUGFIX] Only offer actions on records the user may perform

Juliane Wundermann CR 0 V 0 Hard +710 −48 updated 11/18/26, 13:52

Commit message

The record list offered the selection checkbox for every record, so
editors could select records locked by editlock, records on a locked
page or records without edit permission, and then run bulk actions
DataHandler declines. The record list and the context menu also offered
"Copy" for locked records and pages, which DataHandler declines as well.

The checks are now combined in the internal RecordEditAccess service:
canEdit() covers page permissions, record internals and editlock,
canCopy() mirrors DataHandler, which only requires the show permission
of the page and record internals including the record's own editlock.

The record list renders the selection checkbox for records the user may
change, and for records the user may copy while the clipboard actions
are shown, so editors with show permission keep the bulk transfer to
the clipboard. Its record actions, "cut" and "copy" use the same checks,
as does "Copy" in the context menu of records and pages. Checks now use
the page a record is stored on when records of several pages are listed.

A new functional test pins down which actions editlock prevents in
DataHandler, and an Important changelog entry documents the behaviour.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 4
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/73/95173/4 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/73/95173/4 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Merge conflicts 15

Issues 1

Files 11

Review log 2125

  1. Juliane Wundermann uploaded patch set 1 08/08/26, 09:05

  2. core-ci voted on patch set 1 V +1 08/08/26, 09:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106165

  3. Juliane Wundermann uploaded patch set 2 V +1 08/08/26, 09:56

  4. core-ci voted on patch set 2 V +1 08/08/26, 10:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106170

  5. Tobias Liebig commented on patch set 2 V +1 08/08/26, 10:27

    DatabaseRecordList.php:2207

    ```suggestion // don't show checkbox for not editable tables ```

    DatabaseRecordList.php:2211

    ```suggestion // respect user permissions and editlock for checkbox generation $backendUser = $this->getBackendUserAuthentication(); ```
  6. Juliane Wundermann uploaded patch set 3 V +1 08/08/26, 11:27

  7. Juliane Wundermann commented on patch set 3 08/08/26, 11:29

    DatabaseRecordList.php:2207 Reply

    Done

    DatabaseRecordList.php:2211 Reply

    Done
  8. Tobias Liebig voted on patch set 3 CR +1 V +1 08/08/26, 11:36

  9. core-ci voted on patch set 3 V +1 08/08/26, 11:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106174

  10. Markus Klein commented on patch set 3 08/08/26, 13:37

    Question: If I have only show-permission on the page, I should still be able to select the records for bulk export. Is that working with this patch?
  11. Juliane Wundermann commented on patch set 3 08/09/26, 08:37

    Reply

    The changes to the record list/checkbox only affect the record list and not the export. As far as I understand, the download in the record list is also unaffected: The download includes all records displayed in the list. The download button is only displayed when no record or checkbox is selected. As soon as a record is selected, the download button disappears and the edit and delete buttons appear instead.
  12. Markus Klein commented on patch set 3 08/10/26, 07:19

    Reply

    Right, checked that now myself. But if clipboards are enabled, there is also the transfer to clipboard button then, once selected.
  13. Juliane Wundermann commented on patch set 3 08/10/26, 10:13

    Reply

    As I understand it, the user should not be able to move or copy an element if they do not have permission to edit it. This applies regardless of whether the restriction is due to permissions, an edit lock, or a lack of access rights for a table or content element. If the checkbox isn’t there, the user can’t add the element to the clipboard, and therefore can’t copy or move it either. That’s the current behavior with the patch. Does that answer your question? If not, it would be great if you could describe the scenario that isn’t working right now, along with the expected behavior.
  14. Markus Klein commented on patch set 3 08/10/26, 10:48

    Reply

    Without this patch: If I'm an editor and the page or the record has set an edit-lock, I can still copy the element via the context menu. This is expected, I have read-permissions. This also works in bulk, so selecting a clipboard and checking multiple records and move them to the clipboard. With the patch: I have no checkbox anymore to copy multiple elements.
  15. Juliane Wundermann commented on patch set 3 08/11/26, 08:28

    Reply

    In the current main version, users can add an element with editlock to the clipboard, however, they receive an error if they try to paste or move the element. Therefore, I think it would make sense to hide the checkbox in these cases. This action could not be completed; please contact your administrator. Technical details: 1: Attempt to copy record "tt_content:129" without having permissions to do so [ERROR: Record was locked for editing. Only admin users can change this state.]
  16. Markus Klein commented on patch set 3 08/11/26, 09:02

    Reply

    Oh wow... wasn't aware of that. I'd consider this a bug. I'm really undecided now. Hiding the checkbox for the outlined use-case is of course totally fine. Hiding it for clipboard-interaction is IMO wrong, assuming we fix the bug that copying isn't working right now. I'm not going to vote negatively here, I just want awareness. IMO we first have to figure out if the copy-bug is for some reason intentional (and hence, not a bug then) - but I doubt that. I'm away now for some days, so maybe @j.wundermann@familie-redlich.de can you talk to the core team in Slack on their take?
  17. Juliane Wundermann commented on patch set 3 08/11/26, 09:16

    Reply

    Yeah, I can do that. Is there a dedicated channel for this, or should I just message someone?
  18. Markus Klein commented on patch set 3 08/11/26, 10:17

    Reply

    Thank you. #typo3-cms-coredev is the right channel for anything core development related.
  19. Juliane Wundermann commented on patch set 3 08/13/26, 20:13

    Reply

    I told Benni Mack about it, and he's thinking about it now.
  20. Benni Mack commented on patch set 3 09/23/26, 21:10

    Reply

    sorry, I never got back here. Editlock really means right now that moving or copying is indeed allowed. And we need to document this with an RST file.
  21. Benni Mack uploaded patch set 4 CR +1 V +1 11/15/26, 17:16

  22. Benni Mack commented on patch set 4 11/15/26, 17:17

    Reply

    Updated now... copying only needs show permission (as in DataHandler), so records you can't edit stay selectable for "transfer to clipboard". "Copy" is no longer offered for editlocked records and pages, in the record list and in the context menu, since DataHandler rejects those. The editlock behaviour is now documented in an Important changelog entry and checked by a functional test.
  23. Benni Mack commented on patch set 4 11/15/26, 17:19

    So I have to restate it now: editlock does not allow copying or moving, because DataHandler declines both for non-admins already. A new Important RST documents what editlock does, and EditLockTest pins it down. - New internal service RecordEditAccess (canEdit() / canCopy()), mirroring what DataHandler accepts. It replaces the hand-rolled checks in DatabaseRecordList. - Record list: the checkbox is only rendered for records the user may change, or may copy while clipboard actions are shown. So show-only editors keep the bulk "transfer to clipboard" (@Markus). - "Copy" is no longer offered for records and pages the user can't copy (e.g. editlocked ones), in the record list and the context menu.
  24. core-ci voted on patch set 4 V +1 11/15/26, 17:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114555

  25. Markus Klein commented on patch set 4 11/18/26, 13:52

    Reply Unresolved

    Thanks, I'll retest. I still struggle with the definition of "editlock". As the name suggests, I may not "edit" a record, but I may read it, e.g. to copy it. (makes sense for records that should serve as a copy-template for editors)