Provides dynamic permissions for site_setting of different types.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | issue-2994003-21.patch | 29.24 KB | mr.york |
| #21 | issue-d9-combi--3059909--2994003-21-do-not-test.patch | 29.59 KB | mr.york |
| #20 | issue-d9-combi--3059909--2994003-20-do-not-test.patch | 29.58 KB | mr.york |
| #20 | issue-2994003-20.patch | 29.23 KB | mr.york |
| #19 | issue-d9-combi--3059909--2994003-19-do-not-test.patch | 29.6 KB | mr.york |
Comments
Comment #2
mr.york commentedAttached patch.
Comment #3
mr.york commentedComment #4
nagy.balint commentedThis patch makes it possible to allow certain roles to only be able to edit certain settings entity types and not all of them.
Currently the admin page that lists all types (admin/content/site-settings) can only be viewed if the user has access to all types, but its not a big problem as direct links can be added to the edit form of a type.
Also with the contextual patch: #2994006: Contextual links we can have an edit link directly on the rendered entity.
I think this could be committed as a first step, and then later it can be improved in further patches if required.
Comment #5
scott_euser commentedApologies again for the long delay getting back to you on this.
In principal this is good, but in some cases, people make 50-100 site settings types. It depends whether the approach they use is creating one type and adding all fields within it (2 db tables per field) or create multiple site settings types and reuse the same field for each (like field_label). The latter is more configuration but results in less db tables and quicker initial load into cache. If there are 50-100 site settings types, the permissions UI page will quick get out of hand and run slow with the large number of fields on the page for users with older machines.
For this reason I would prefer to make this optional, either:
Thanks for your work on this thus far!
Comment #6
mr.york commentedCreated a submodule site_settings_type_permissions.
Comment #7
nagy.balint commentedPutting it back to needs work due typo.
Comment #8
mr.york commentedFixed the typo.
Comment #9
mr.york commentedLittle fixes.
Comment #10
nagy.balint commentedPutting it back to needs work for now.
We are checking if we can add a generic permission "access site settings overview".
This would replace the requirement in the route.
Then it could make this admin list available even if the user only has access to some of the types.
I think this would be the best option, as core also has access content overview and separate administer content.
Comment #11
mr.york commentedAdd "access site settings overview" permission and fixed SiteSettingEntityListBuilder.
Comment #12
mr.york commentedReally add "access site settings overview" permission and fixed SiteSettingEntityListBuilder.
Comment #13
nagy.balint commentedAdded post update hook as now the new permission which is needed for the overview page is "access site settings overview" while previously it was "edit site setting entities".
Also fixed the ListBuilder after further testing.
Comment #14
nagy.balint commentedComment #15
mr.york commentedFixed create button show has access.
Comment #17
mr.york commented#3059909: Drupal 9 Deprecated Code Report compatible patch. Do not test.
Comment #18
nagy.balint commented#17 is a patch that can be applied together with the patch from https://www.drupal.org/project/site_settings/issues/3059909, so the test cannot run on that one separately.
Comment #19
mr.york commentedAdd permission tests.
Comment #20
mr.york commentedCoding standard and typo fix.
Comment #21
mr.york commentedand once again coding standard fix
Comment #23
scott_euser commentedExcellent thank you! I have made a few small modifications to make the code a bit more readable, particularly around the SiteSettingEntityListBuilder when there are missing bundles. I was unable to apply to D9 deprecated mixed patch.
Thanks for all your hard work on this, I am sure this feature will be useful for others!
Comment #24
nagy.balint commentedThanks!
We will reroll the d9 patch next week in the other issue.
Comment #25
scott_euser commentedNo need, I am almost done sorting it, the majority still applied anyways. Thanks!