Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Ready for review Stale

95343[FEATURE] Add `adminOnly` for TCA columns

Daniel Windloff CR 0 V 0 Hard +366 −33 updated 09/08/26, 08:09

Commit message

Add TCA option to restrict access to specific
columns for admin users.

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/43/95343/4 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/43/95343/4 && git cherry-pick FETCH_HEAD

Review

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

Issues 3

Files 15

Review log 1216

  1. Daniel Windloff uploaded patch set 1 08/16/26, 07:34

  2. core-ci voted on patch set 1 V -1 08/16/26, 07:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106781

  3. Daniel Windloff uploaded patch set 2 V -1 08/16/26, 07:46

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

  5. Georg Ringer commented on patch set 2 08/16/26, 08:47

    the issue I remember having with the DISPLAY_COND is that this if an editor copies the record, the value is not copied as well. how is this behaviour with the new flag?
  6. Daniel Windloff commented on patch set 2 08/16/26, 09:09

    Reply

    The behavior is the follwing: - Admin set values for columns with displayCond (1) and admin only (2) - Editor can not see these columns (1, 2) - If the editor copies this entry, the column with the displayCond (1) will be copied, the column with adminOnly (2) not - If the admin copies this entry, both columns (1,2) will be copied.
  7. Georg Ringer commented on patch set 2 08/16/26, 10:27

    Reply

    which means that would be a breaking change and I am not sure if this is desired? If someone sets up e.g. tsconfig_includes to configure e.g. a sysfolder, this behaviour should be copied as well, shouldn't it?
  8. Daniel Windloff commented on patch set 2 08/16/26, 14:14

    Reply

    I added a TCA migration to replace the display condition HIDE_FOR_NON_ADMINS with adminOnly, which has the former behavior of the display condition. That's why I don't see, that the change is breaking. To avoid this migration, you have to change the configuration to adminOnly=>false. To tsconfig_includes: I assume the opposite. If the page is copied by a non-admin, no PageTSConfig should be taken into account. This is the current behavior and double checked via TCA config and a specific hook: https://git.typo3.org/typo3/typo3/-/blob/main/typo3/sysext/core/Classes/Hooks/PagesTsConfigGuard.php?ref_type=heads
  9. Daniel Windloff rebased onto patch set 3 V +1 09/04/26, 06:56

  10. Simon Schaufelberger commented on patch set 3 09/04/26, 07:17

    TcaMigration.php:141

    Only one to

    Feature-110492-AddAdminOnlyForTCAColumns.rst:23

    2 white spaces used

    Feature-110492-AddAdminOnlyForTCAColumns.rst:32

    2 white spaces used
  11. core-ci voted on patch set 3 V +1 09/04/26, 07:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107815

  12. Daniel Windloff uploaded patch set 4 V +1 09/04/26, 07:25

  13. Daniel Windloff commented on patch set 4 09/04/26, 07:25

    TcaMigration.php:141 Reply

    Done

    Feature-110492-AddAdminOnlyForTCAColumns.rst:23 Reply

    Done

    Feature-110492-AddAdminOnlyForTCAColumns.rst:32 Reply

    Done
  14. core-ci voted on patch set 4 V +1 09/04/26, 07:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107818

  15. Benni Mack commented on patch set 4 09/08/26, 06:32

    I wonder what the difference could then be between "exclude => true" and "adminOnly => true"? These options then depend on each. Also: We need an option "systemMaintainerOnly". What I'm saying is: I'd love to have a more flexible possibility than this. You know me... I've been thinking about this for a long time. Thus, I wonder if we need ONE new option that superseds "exclude", "HIDE_FOR_NON_ADMINS", "stepUp", and also allows to differentiate between read+write for a specific field, and we should allow to override this like overriding per a specific type (CType, doktype etc) in columnsOverrides. What do you think?
  16. Daniel Windloff commented on patch set 4 09/08/26, 08:09

    Reply Unresolved

    Hi Benni, The difference is that non-admins can also be granted rights via `exclude`. A more nuanced rights management system, such as `exclude` (group/user allowed), `AdminOnly`, `Systemmaintainer only`, etc., would certainly be beneficial. The goal of this change was to build upon an existing naming for an option for tables and remove the `displayConditions` from persistence to better differentiate between the DataHandler and the FormEngine. Even without a major overhaul, I saw this as an advantage. How should I proceed? Should I abandon the patch in favor of a more comprehensive access control concept?