Standaloneusers - move canonical role creation from core installer to extension installer #34218
+160
−162
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This is helpful when migrating from non-Standalone. Currently you have to create these roles manually. This way it can be done during
cv en standaloneusers. Also canonise the canonical role names withconsts.Before
After
Comments
Our starting Roles (admin, staff, everyone) sort of stride the "example data" vs "essential data" line which I think defies a definitive answer to where they should be created:
everyonehas a very special role - we need to know what permissions anonymous users have - it is programmatically essential.adminhas some controls to prevent it being edited or deleted. I sort of think you might have a site without it (do all the superadmining by CLI, users with logins have less than superadmin permission). It sort of helps possibility of getting locked out from a site, though I don't think it's totally watertight (you can edit users so none has the admin role?)staffis basically a useful starting point of how you might want to configure an interim role.From my perspective
everyoneshould definitely be created in extension install, because you can't log in to your site without it. Givenadminis currently canonised, I think it belongs in the same place (I'm less clear it should be canonised, but out of scope).Staff is less clear. I could be conviced to leave that one in the setup plugin. But it seems simpler to have them in the same place.