Review main Merged Breaking

74126[!!!][TASK] Simplify TCA authMode settings

Christian Kuhn CR +2 V +2 Expert +865 −700 updated 04/01/22, 08:36

Commit message

To prepare towards a deployable backend group access
rights system, some of the more obscure options are
removed to reduce overall complexity.

* TYPO3_CONF_VARS['BE']['explicitADmode'] is finally
  gone: Following a deny list approach is a flawed security
  system. TYPO3's default setting (explicitADmode=allow)
  follows the very common "Least Privileged" principle,
  so editors need to be explicitly given access to a
  CType, as is done with all other permissions.

* The only valid value for TCA config option "authMode"
  on type="select" fields is now "explicitAllow". The
  previous "explicitDeny" value is abandoned following
  the reasoning above. The value "individual" is abandoned
  since it is a very rarely used setting (not a single
  match in TER).

* With authMode="individual" being gone, the select item
  array keys on position six that could be set to "EXPL_DENY"
  and "EXPL_ALLOW" are obsolete.

* Field "explicit_allowdeny" in table be_groups is
  simplified. This was a comma separated list of
  colon separated: "table:field:value:ALLOW/DENY".
  The last "ALLOW" or "DENY" is now obsolete.

The patch removes the above handling from the core. A
TCA migration scans TCA for invalid options and adapts
them. An upgrade wizard is in place to clean up the
be_groups explicit_allowdeny field of existing rows.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 31

Show 11 more files

Review log 1518

  1. Christian Kuhn uploaded patch set 1 03/31/22, 13:02

  2. core-ci voted on patch set 1 V -1 03/31/22, 13:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25306

  3. Christian Kuhn uploaded patch set 2 03/31/22, 15:31

  4. core-ci voted on patch set 2 V +1 03/31/22, 15:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25311

  5. Stefan Bürk voted on patch set 2 V +1 CR +1 03/31/22, 16:06

  6. Benni Mack voted on patch set 2 V +1 CR +1 03/31/22, 16:36

  7. Oli Bartsch commented on patch set 2 CR -1 03/31/22, 17:12

    Testing
  8. Oli Bartsch commented on patch set 2 03/31/22, 19:05

    NewContentElementController.php:301

    Could be renamed

    TcaItemsProcessorFunctions.php:410

    Could be adjusted.

    TcaItemsProcessorFunctions.php:418

    Could be renamed.

    TcaItemsProcessorFunctions.php:427

    Previous !(bool)($fieldConfig['authMode'] ?? false) check should be just fine, since 'explicitAllow' is the only possible option.

    TcaMigration.php:918

    Any reason for not using isset() ?

    TcaMigration.php:930

    Seems like this description does no longer describe the performed migration.

    TcaMigration.php:973

    Same question as above, any reason for not using isset() ?

    TcaMigration.php:976

    We do not change this to bool, since 3rd party might check fort the string explicitly, right?

    Breaking-97265-SimplifiedAccessModeSystem.rst:107

    This sounds like big upgrade efforts for administrators currently using "explicitDeny", especially with large user/group setups. Is there any possibility to invert DENY / ALLOW, like I did with the blinkLink[Fields|Options] in https://review.typo3.org/c/Packages/TYPO3.CMS/+/73866? Thinking about this, we would need the final items array which might be influenced by itemsProcFuncs.. not that easy I fear.

    BackendGroupsExplicitAllowDenyMigrationBefore.csv:7

    Should we just for the completnes also add an invalid case. Something like ,5,"aTable:aField:willBeKept:::,aTable:aField:toMigrate:ALLOW,aTable:aField:willBeRemoved:DENY"
  9. Christian Kuhn commented on patch set 2 03/31/22, 22:33

    NewContentElementController.php:301 Reply

    Done

    TcaItemsProcessorFunctions.php:410 Reply

    Done

    TcaItemsProcessorFunctions.php:418 Reply

    Done

    TcaItemsProcessorFunctions.php:427 Reply

    I'd say this variant is more explicit and we should go with it.

    TcaMigration.php:918 Reply

    yes. I don't care about the value, even if it's false. array_key_exists() is more precise here.

    TcaMigration.php:930 Reply

    Done

    TcaMigration.php:973 Reply

    yes. this is simply more precise.

    TcaMigration.php:976 Reply

    yeah. i wanted to key 'explicitAllow', since this reduces the migration overhead for the only 'sane' option that is currently in use in the wild.

    Breaking-97265-SimplifiedAccessModeSystem.rst:107 Reply

    yes. there is no direct migration possible. This would give serious headaches. TER search showed no usages, though. So solution is to not migrate these, but let the upgrade wizard show "you need to update access rights for *these* fields manually".

    BackendGroupsExplicitAllowDenyMigrationBefore.csv:7 Reply

    imho covered by ,3,"aTable:aField:toMigrate1:ALLOW:dangling,aTable:aField:okTuple" already.
  10. Christian Kuhn uploaded patch set 3 03/31/22, 22:33

  11. core-ci voted on patch set 3 V +1 03/31/22, 22:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25323

  12. Oli Bartsch voted on patch set 3 V +1 CR +1 04/01/22, 08:05

  13. Benni Mack voted on patch set 3 V +1 CR +1 04/01/22, 08:06

  14. Benni Mack commented on patch set 3 04/01/22, 08:06

    not a fan of array_key_exists, but OK.
  15. Stefan Bürk voted on patch set 3 CR +1 04/01/22, 08:09

  16. Stefan Bürk commented on patch set 3 V +1 04/01/22, 08:32

    Reply

    Ack. But there are (rare) case which it make sense. And in these cases, I think it is correct to use it.
  17. Benni Mack voted on patch set 3 V +2 CR +2 04/01/22, 08:36

  18. Benni Mack merged patch set 4 04/01/22, 08:36