83087[FEATURE] Allow creating backend user group presets
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Garvin Hicking +1
-
Verified V +2 Done
- Stefan Bürk +2
- Garvin Hicking +1
- core-ci +1 CI
Issues 1
Files 11
- typo3/sysext/core/Documentation/Changelog/13.1/Feature-103187-AddCliCreateBeUserGroupCommand.rst6new+63 −0
- typo3/sysext/install/Classes/Command/BackendUserGroupType.phpnew+63 −0
- typo3/sysext/install/Classes/Command/LanguagePackCommand.php+1 −0
- typo3/sysext/install/Classes/Command/SetupCommand.php+0 −1
- typo3/sysext/install/Classes/Command/SetupDefaultBackendUserGroupsCommand.php3new+114 −0
- typo3/sysext/install/Classes/Controller/InstallerController.php2+3 −1
- typo3/sysext/install/Classes/Service/SetupService.php14+101 −5
- typo3/sysext/install/Classes/ServiceProvider.php2+22 −0
- typo3/sysext/install/Configuration/PermissionPreset/be_groups_advanced_editor.yaml4new+225 −0
- typo3/sysext/install/Configuration/PermissionPreset/be_groups_editor.yaml4new+137 −0
- typo3/sysext/install/Resources/Private/Templates/Installer/ShowDefaultConfiguration.html9+17 −0
Review log 5980
Show 3955 earlier messages
-
Marcin Sągol uploaded patch set 1 02/23/24, 11:21
-
core-ci voted on patch set 1 V -1 02/23/24, 11:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53477
-
Andreas Kienast commented on patch set 1 CR -1 02/23/24, 11:42
be_groups_advanced_editor.yaml:1bybe_groups_editor.yaml:1byShowDefaultConfiguration.html:47Do you want pre-configured backend groups?ShowDefaultConfiguration.html:49backend groups -
Marcin Sągol uploaded patch set 2
CR -1V -102/23/24, 11:48 -
Marcin Sągol uploaded patch set 3 02/23/24, 11:50
-
core-ci voted on patch set 2 V +1 02/23/24, 11:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53480
-
core-ci voted on patch set 3 V +1 02/23/24, 11:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53481
-
Marcin Sągol commented on patch set 3 02/23/24, 12:00
InstallerController.php:644ReplyDonebe_groups_advanced_editor.yaml:1ReplyDonebe_groups_editor.yaml:1ReplyDoneShowDefaultConfiguration.html:47ReplyDoneShowDefaultConfiguration.html:49ReplyDone -
Marcin Sągol uploaded patch set 4
V +102/23/24, 13:00 -
core-ci voted on patch set 4 V +1 02/23/24, 13:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53490
-
Oliver Klee updated the commit message in patch set 5
V +102/23/24, 14:48 -
core-ci voted on patch set 5 V +1 02/23/24, 14:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53507
-
Oli Bartsch commented on patch set 5 CR -1 02/23/24, 21:13
Missing feature ReST.SetupBackendGroupsCommand.php:18I suggest having this command in ext:backendSetupBackendGroupsCommand.php:51Seems like `addOption()` does not feature a sixth parameter.SetupBackendGroupsCommand.php:72We should persist this with `$input->setInteractive()`.SetupBackendGroupsCommand.php:98I suggest using `SymfonyStyle` instead.ServiceProvider.php:448I suggest using backend:usergroup:create similar to the existing backend:user:create command. -
Marcin Sągol commented on patch set 5 02/26/24, 09:55
SetupBackendGroupsCommand.php:51ReplyWell i does: array|Closure $suggestedValues – The values used for input completion -
Marcin Sągol uploaded patch set 6
CR -1V +102/26/24, 11:17 -
Marcin Sągol updated the commit message in patch set 7 02/26/24, 11:18
-
Marcin Sągol commented on patch set 7 02/26/24, 11:19
SetupBackendGroupsCommand.php:18ReplyDoneSetupBackendGroupsCommand.php:72ReplyDoneSetupBackendGroupsCommand.php:98ReplyDoneServiceProvider.php:448ReplyDone -
Marcin Sągol commented on patch set 7 02/26/24, 11:19
SetupBackendGroupsCommand.php:18ReplyDoneSetupBackendGroupsCommand.php:72ReplyDone -
core-ci voted on patch set 6 V -1 02/26/24, 11:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53598
-
core-ci voted on patch set 7 V -1 02/26/24, 11:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53599
-
Marcin Sągol uploaded patch set 8
V -102/26/24, 12:47 -
core-ci voted on patch set 8 V +1 02/26/24, 12:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53613
-
Garvin Hicking commented on patch set 8 02/28/24, 08:37
Some thoughts and documentation ideas. We should really decide on one consistent term. Generally: I like this concept of presets a lot and see much potential here, thanks so much for working on it!CreateBackendUserGroupCommand.php:67In the other instances you use the term "backend Role groups" and sometimes "backend user groups", could you unify this to only consistently use one term? Probably we should call it either "backend roles" or "backend user groups"? (Also, "Role" is not really a very specific term here and IMO doesn't rectify uppercasing?)CreateBackendUserGroupCommand.php:68The "None" option exists here, but not in the list above? Maybe for the future we could use an enum or object constant to reference the list of allowed values here?Services.yaml:20use "group" singular hereFeature-103187-AddCliCreateBeUserGroupCommand.rst:40Maybe use "Advanced Editor" here with quotes for better readability?SetupService.php:221Just an idea: Currently this "supermethod" only operates on two fixed presets. I wonder if in the future this may be expanded, and it's worth at this point already to create a more specific pattern for usergroup creation? Something like a DTO/service/factory. At this point it might be overkill, but I'm afraid that we'll get new presets here and then these blocks get copy and pasted...?SetupService.php:226I wonder if we should prefer to use the DataHandler here, for forward-compatibility when TCA changes occur and more fields may be populated, and also have a history entry about the creation of these records?ShowDefaultConfiguration.html:47"Do you want to setup pre-configured user groups?" (or whatever the term for "backend user role group" will be used ;)ShowDefaultConfiguration.html:49I wonder if this should also offer the ability to either create Editor AND advanced editor or either. Would a dropdown/multiple checkboxes here be more consistent with the CLI option that allows more flexibility? -
Marcin Sągol commented on patch set 8 02/29/24, 10:47
Services.yaml:20ReplyWould it be a good idea if the command allows to create 2 by default?SetupService.php:221ReplyI was considering DTO etc. but not now. The core team members plan to introduce presets for various data types and after they are introduced and merged into TYPO3 core, this code can be updated. For now i wanted it to be as simple and small as possible, to make it easier to change it in the future.ShowDefaultConfiguration.html:49ReplyBenni suggested only checkbox. I think that is fone for now. -
Garvin Hicking commented on patch set 8 02/29/24, 11:03
Services.yaml:20ReplyThen the beginning of the sentence needs to remove "a" because that currently refers to the singular. both ways are fine by me :) -
Marcin Sągol commented on patch set 8 02/29/24, 11:57
CreateBackendUserGroupCommand.php:67ReplyI will follow the `backend user group` naming, as suggested.CreateBackendUserGroupCommand.php:68ReplyThe None is only too easily cancel the command execution in the interactive mode.Services.yaml:20ReplyDone -
Marcin Sągol uploaded patch set 9
V +102/29/24, 12:03 -
Marcin Sągol uploaded patch set 10 02/29/24, 12:06
-
Marcin Sągol uploaded patch set 11 02/29/24, 12:07
-
core-ci voted on patch set 9 V -1 02/29/24, 12:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53717
-
Marcin Sągol commented on patch set 9 02/29/24, 12:10
CreateBackendUserGroupCommand.php:67ReplyDoneFeature-103187-AddCliCreateBeUserGroupCommand.rst:40ReplyDoneSetupBackendGroupsCommand.php:51ReplyDoneSetupService.php:226ReplyThis code is part of the Install package atm. so I am not sure if we should use DH here. Other core devs feedback is welcomed.ShowDefaultConfiguration.html:47ReplyDone -
core-ci voted on patch set 10 V -1 02/29/24, 12:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53718
-
core-ci voted on patch set 11 V -1 02/29/24, 12:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53719
-
Marcin Sągol uploaded patch set 12
V -102/29/24, 12:18 -
core-ci voted on patch set 12 V +1 02/29/24, 12:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53720
-
Garvin Hicking commented on patch set 12 CR -1 02/29/24, 15:07
On it, there's an issue with the no-interaction and I'd really like to get some more structure into the usergroup defaults/string, will make a proposal -
Garvin Hicking uploaded patch set 13
CR -1V +102/29/24, 15:51Suggestion for Enum and some unification ideas -
core-ci voted on patch set 13 V -1 02/29/24, 15:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53729
-
Garvin Hicking commented on patch set 13 CR +1 V +1 02/29/24, 15:58
Works for me; the open issues are open to feedback from others of course.CreateBackendUserGroupCommand.php:68ReplyI took the liberty to upload a patch set that uses a ENUM to enforce a more streamlined usage of the preset names and their retrieval. Feel free to revert if you don't like it. I changed the interactive mode a bit to be not required when you use the "--groups" or "-g" command. As soon as that is set, it doesn't ask. IMO this makes the conditions for checking the option a bit clearer.SetupService.php:40I'm not sure at this place if the change to "readonly" could have side effects. Class is marked "internal" so it wouldn't be a BC at least! 😊SetupService.php:221ReplyI understand. I added a note at the place for a future refactoring to easy my mind.SetupService.php:226ReplyProbably the installer doesn't have a working DH instance at this point, making it more complex. I think we're good with this then.ShowDefaultConfiguration.html:49ReplyAh, I did not know about this. I added a note here to indicate that people can rename their presets, and used the "backend user group" name here. -
Garvin Hicking uploaded patch set 14
CR +1V +102/29/24, 16:00CGL -
Garvin Hicking uploaded patch set 15 02/29/24, 16:02
Fix ENUM class comment -
core-ci voted on patch set 14 V +1 02/29/24, 16:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53731
-
core-ci voted on patch set 15 V +1 02/29/24, 16:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53732
-
Garvin Hicking commented on patch set 15 CR +1 V +1 03/01/24, 13:43
(I can live without the ENUM or other abstraction; if that overcomplicates things, I just had to get this redundancy off my chest *g*) -
Guido Schmechel commented on patch set 15 03/02/24, 12:44
CreateBackendUserGroupCommand.php:883rd parameter neccessary?SetupService.php:263Maybe it's just my taste, but isn't the readability quite complex? Could it be simplified with a loop and an array? What are the other opinions? -
Nikita Hovratov commented on patch set 15 03/03/24, 19:00
be_groups_editor.yaml:1to be -
Christian Kuhn commented on patch set 15 03/04/24, 07:32
SetupService.php:40Replyreadonly is ok: classes that have no properties apart from DI stuff (which should be readonly), can be marked readonly without headaches. -
Marcin Sągol commented on patch set 15 03/04/24, 14:36
SetupService.php:263Reply@guido.schmechel@brandung.de I would keep it as it is for now. In the future, when the concept of presets for various record types is implemented, this may change, and perhaps some DTOs will be used. I don't want to complicate things at the moment, as it would necessitate more changes in the future when adapting to presets introduced in the core. -
Marcin Sągol uploaded patch set 16
CR +1V +103/04/24, 14:43 -
Marcin Sągol commented on patch set 16 03/04/24, 14:43
CreateBackendUserGroupCommand.php:88ReplyDonebe_groups_editor.yaml:1ReplyDone -
core-ci voted on patch set 16 V +1 03/04/24, 14:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53861
-
Garvin Hicking commented on patch set 16 CR +1 V +1 03/04/24, 16:30
SetupService.php:40ReplyAcknowledged -
Marcin Sągol commented on patch set 16 03/05/24, 13:55
CreateBackendUserGroupCommand.php:68ReplyDoneSetupService.php:263ReplyDone -
Stefan Bürk commented on patch set 16 CR -1 03/08/24, 16:10
on it ...BackendUserGroupType.php:23We should mark this enum as internal. It make sense to refactor this to registry instead, so let's keep that door open for TYPO3 v13.BackendUserGroupType.php:31``` @return string[] ```BackendUserGroupType.php:44``` @return array<non-empty-string, non-empty-string> ```CreateBackendUserGroupCommand.php:68ReplyI make the enum internal. The enum move was not really required here, and a proper registry more suitable in the longterm. With the internal mark we can adjust this later on to put multiple pieces of the big picture together.CreateBackendUserGroupCommand.php:107I'm not really happy with this try-catch block. This removes the ability to display the error/exception stacktrace with `-vvv`. I would remove this try-catch here.Feature-103187-AddCliCreateBeUserGroupCommand.rst:14``` :bash:`...` ```Feature-103187-AddCliCreateBeUserGroupCommand.rst:22``` :bash:`...` ```be_groups_advanced_editor.yaml:178Editor should not see the user forgot hash (or edit it) -
Stefan Bürk uploaded patch set 17
CR +1V +103/08/24, 16:41
-
core-ci voted on patch set 17 V +1 03/08/24, 16:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54287
-
Stefan Bürk commented on patch set 17 03/08/24, 16:47
SetupService.php:46tailing comma ... -
Stefan Bürk commented on patch set 17 V +1 03/08/24, 16:48
BackendUserGroupType.php:23ReplyDoneBackendUserGroupType.php:31ReplyDoneBackendUserGroupType.php:44ReplyDoneCreateBackendUserGroupCommand.php:107ReplyDoneFeature-103187-AddCliCreateBeUserGroupCommand.rst:14ReplyDoneFeature-103187-AddCliCreateBeUserGroupCommand.rst:22ReplyDoneSetupService.php:46ReplyDonebe_groups_advanced_editor.yaml:178ReplyDone -
Stefan Bürk updated the commit message in patch set 18
V +103/08/24, 16:54 -
core-ci voted on patch set 18 V +1 03/08/24, 17:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54291
-
Stefan Bürk voted on patch set 18 CR +1 V +1 03/08/24, 17:28
-
Stefan Bürk commented on patch set 18 03/08/24, 17:29
@marcin@soee.pl thanks for this patch and also taking care about removing into `EXT:backend` -
Benni Mack updated the commit message in patch set 19
CR +1V +103/08/24, 17:43 -
core-ci voted on patch set 19 V +1 03/08/24, 17:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54294
-
Benni Mack commented on patch set 19 CR -1 03/08/24, 19:43
CreateBackendUserGroupCommand.php:26This does not work. We now have a new dependency from EXT:backend -> EXT:install, even though EXT:install is optional. Even though requested differently before, this Command MUST go into EXT:install. I also think we should name this one differently. It is a CLI Command that creates be groups from a defined list of presets, which are hard-coded. "setup:begroups:default" -
Marcin Sągol uploaded patch set 20
CR -1V +103/12/24, 08:43 -
Marcin Sągol commented on patch set 20 03/12/24, 08:44
CreateBackendUserGroupCommand.php:26ReplyI have moved the command to ext:install again. I have left the Enum class in the ext:backend though - this one might be used in the future when we introduce a more advanced commands for backend user creation for existing presets. -
core-ci voted on patch set 20 V +1 03/12/24, 08:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54401
-
Stefan Bürk commented on patch set 20 CR -1 03/12/24, 09:05
on it ... -
Stefan Bürk commented on patch set 20 03/12/24, 11:38
CreateBackendUserGroupCommand.php:26ReplyThe enum should be moved to. We want to avoid cross dependencies in this case. For now. I removed the todo comment from the enum. A additionally enhanced version for runtime usage in the `EXT:backend` should not use a enum, and implement something like a preset registry so agencies can provide/register custom presets as shared package (agengy package) or through the local site package. That's unrelated to this implementation. Also, it should not use the setupservice than. We have to look into it and move some parts from `EXT:install` to `EXT:core` or suitable places anyway - but that's out of scope for this patch. Due to the shared nature with the GUI based installer, and the failsafe nature of `EXT:install` this cannot be extensible and needs to be available earlie with a hard set preset. The later/additional configurable and extensible implementation is another approach, which should not used in the `EXT:install` then - so we need this separated and similar but different context solution. Therefore, moved back to `EXT:install` as a self containt implementation with a command name which leaves the command name open for a enhanved implementation. Sorry for the ping-pong on here, but it took some brain tennis to decide these things. However, thanks for providing this change and taking care in between for the changes - albeit giving a taste of playing, which was not intended. I will take care of the additional changes and push them shortly, currently still playing aroung with the patch (testing). -
Stefan Bürk uploaded patch set 21
CR -1V +103/12/24, 11:52 -
Guido Schmechel wrote 03/12/24, 11:54
Removed cc Guido Schmechel. -
Stefan Bürk commented on patch set 21 CR -1 03/12/24, 11:56
CreateBackendUserGroupCommand.php:26ReplyDoneSetupDefaultBackendUserGroupsCommand.php:101The command can be executed at a later point. In the current implementation, the setup service will simply add new user groups with the permissions - on every execution. That means, that if executed 10x with `both` you will end up with ten "Editor" groups and ten "Advanced Editor" groups. Therefore, again a temp -1 - will think about it how to deal with it and add the solution then. Commented so maybe someone can ping opinion on this in the meanwhile). -
core-ci voted on patch set 21 V +1 03/12/24, 12:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54420
-
Marcin Sągol commented on patch set 21 03/12/24, 12:04
CreateBackendUserGroupCommand.php:26ReplyThank you @stefan@buerk.tech. The idea from the beginning was to make it as simple as possible for now, keeping in mind that there are plans to introduce more general presets for various record types in the TYPO3 core. Then there could be a registry and all the other stuff to make it extensible etc. In the future the registry could be stored in the `ext:core` or `ext:backend` and used by `ext:install` i think as it would be one direction dependency from `ext:install` only. Probably the installer GUI should allow only the default presets to be used/handled, while the command (either the one introduced in this patch or a separate one) should handle all the presets from the not yet existing registry in the future. So for example user could enter the desired group name and apply 1..n selected presets through CLI. But this is not the scope of this task/patch :) -
Marcin Sągol commented on patch set 21 03/12/24, 12:10
SetupDefaultBackendUserGroupsCommand.php:101ReplyIt should add new groups only if the dedicated checkbox was chcked on the last installation step. Yes we can end up with multiple groups with the same name but still this would be probably a developer decision. Such groups can be renamed easily from the backend module. If we would like to handle this case more user friendly, there could be check if any of those groups exits (by name) and if yes, as user if he wants to create them any way or name set custom name for new groups. -
Stefan Bürk commented on patch set 21 CR +1 V +1 03/12/24, 13:14
CreateBackendUserGroupCommand.php:26ReplyWe will see and postpone this. But for now the clear encapsulation in the optional `ext:install`. The goal is to get this now in a first version in while avoiding to much cross-spreading for the start.SetupDefaultBackendUserGroupsCommand.php:101ReplyThe point is the `cli command` and not the UI installer. Thought about it, and also talked with Benni. We start with the current state - so if the command is executed again, the groups are added again. Without duplicate checks etc. and see where the journey goes. No need to delay this further. -
Garvin Hicking commented on patch set 21 CR +1 V +1 03/12/24, 13:39
The "duplicate calls" are a valid point, but I'd argue also expected behavior if run multiple times. I'd also say to merge as-is and enhance this later when "custom" presets come into it. Then it'll be easier to query a registry. -
Stefan Bürk voted on patch set 21 CR +2 V +2 03/13/24, 08:46
-
Stefan Bürk merged patch set 22 03/13/24, 08:46
InstallerController.php:644