Review main Abandoned

75007[FEATURE] Include be_group rights from yaml files

Andreas Häfner CR 0 V 0 Hard +269 −1 updated 06/20/24, 07:30

Commit message

BE-group permissions are persisted completely in database and therefore
are not deployable as files and invisible for code versioning systems.
To allow such "deployable" permissions, a new TCA-field
"yamlconfig_includes" has been introduced, which allows to import
permissions from yaml files.
Just as include_static_file for sys_template or tsconfig_includes
in pages, this field allows to select one or more files, which
can be provided by TYPO3 extensions.
A file can be registered by any extension via
ExtensionManagementUtility::registerGroupPermissionFile().
The format of the registered files is yaml and need to contain an
associative array of the permission related column names
as used in be_groups.
The entries, which typically are comma separated values, can be noted
as plain arrays. A yaml file needs to contain the column names,
which are intended to be added. Other possible  column names
can be omitted.

The content of these files is merged with permissions from database
in GroupResolver::resolveGroupsForUser() before the event
AfterGroupsResolvedEvent() is dispatched.
As in inclusion of subgroups, permissions are accumulated. There
is no possibility to remove already available permissions.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 6

Review log 1722

  1. Andreas Häfner uploaded patch set 1 07/01/22, 09:38

  2. Andreas Häfner marked it work in progress 07/01/22, 09:39

  3. Mathias Brodala commented on patch set 1 07/01/22, 09:43

    Thanks A LOT for tackling this. We have been using a tiny subset of this internally for years but never got around finishing/extending it.

    Feature-95904-ImportBeGroupsAccessRightsFromYamlIncludes.rst:14

    You mean "permissions" which should be used as term everywhere.

    Feature-95904-ImportBeGroupsAccessRightsFromYamlIncludes.rst:18

    "YAML" ;-)

    Feature-95904-ImportBeGroupsAccessRightsFromYamlIncludes.rst:39

    This is not necessary and should be removed here.

    Feature-95904-ImportBeGroupsAccessRightsFromYamlIncludes.rst:76

    Maybe we can allow a list of values instead of a CSV string here (will need on-the-fly conversion then.) Otherwise we should mention YAML multiline strings to have this in a format suitable for Git: https://yaml-multiline.info

    Feature-95904-ImportBeGroupsAccessRightsFromYamlIncludes.rst:80

    BTW, no need for quotes here.
  4. core-ci voted on patch set 1 V -1 07/01/22, 09:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28558

  5. Andreas Häfner uploaded patch set 2 07/05/22, 06:36

  6. core-ci voted on patch set 2 V +1 07/05/22, 06:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28652

  7. Andreas Häfner uploaded patch set 3 07/06/22, 06:21

  8. Andreas Häfner marked it ready for review 07/06/22, 06:24

  9. core-ci voted on patch set 3 V +1 07/06/22, 06:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28691

  10. Mathias Brodala commented on patch set 3 07/06/22, 07:16

    Feature-95904-ImportBeGroupsAccessRightsFromYamlIncludes.rst:14 Reply

    Done

    Feature-95904-ImportBeGroupsAccessRightsFromYamlIncludes.rst:18 Reply

    Done

    Feature-95904-ImportBeGroupsAccessRightsFromYamlIncludes.rst:39 Reply

    Done

    Feature-95904-ImportBeGroupsAccessRightsFromYamlIncludes.rst:76 Reply

    Done

    Feature-95904-ImportBeGroupsAccessRightsFromYamlIncludes.rst:80 Reply

    Done
  11. Simon Schaufelberger commented on patch set 3 CR -1 07/06/22, 08:42

    please also have a look at https://github.com/b13/permission-sets which just got open sourced and is doing exactly the same but differently.

    GroupResolver.php:114

    no need. can be removed.

    GroupResolver.php:149

    annotations can be removed

    ExtensionManagementUtility.php:1204

    property type missing
  12. Andreas Häfner uploaded patch set 4 07/14/22, 06:25

  13. core-ci voted on patch set 4 V +1 07/14/22, 06:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29113

  14. Andreas Häfner commented on patch set 4 07/14/22, 06:40

    Reply Unresolved

    This Extension applies mapping from special yaml semantic to database based permissions. I wannted to keep configuration simple and compareable to databse so export of existing databasepermissions would be a nobrainer.

    GroupResolver.php:149 Reply

    Changed it. But why that? Such return annotations can be found all over the core code. Why should I ommit it at this point?
  15. Andreas Kienast commented on patch set 4 07/14/22, 06:42

    GroupResolver.php:149 Reply

    These annotations were required before type declarations were possible. Since this method is declared to return `?string`, the annotation is superfluous.
  16. Mathias Brodala commented on patch set 4 07/14/22, 09:57

    GroupResolver.php:149 Reply

    As is the @param annotation which should be dropped too.
  17. Simon Schaufelberger commented on patch set 4 08/24/23, 15:08

    GroupResolver.php:114 Reply

    Done

    GroupResolver.php:149 Reply

    Done

    ExtensionManagementUtility.php:1204 Reply

    Done
  18. Simon Schaufelberger uploaded patch set 5 V +1 08/24/23, 15:22

  19. core-ci voted on patch set 5 V +1 08/24/23, 15:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45789

  20. Jörg Bösche voted on patch set 5 CR +1 08/25/23, 13:43

  21. Andreas Häfner voted on patch set 5 V +1 CR +1 08/28/23, 09:30

  22. Georg Ringer abandoned the change 06/20/24, 07:30