- Issue created by @benjifisher
- Merge request !17Add dependency information to dynamic permissions β (Merged) created by benjifisher
- last update
10 months ago 34 pass - Issue was unassigned.
- Status changed to Needs review
10 months ago 3:03am 25 January 2024 - πΊπΈUnited States benjifisher Boston area
The MR uses the
node
module as a model.Testing steps:
- Install Drupal 10.2.x with the Standard profile.
- Enable
search_api_autocomplete
andsearch_api_db_defaults
(and dependencies). - Enable "Search content" on Default content index > Autocomplete (
/admin/config/search/search-api/index/default_index/autocomplete
). - Assign the "Use autocomplete for the Search content search" permission to the Content editor role on
/admin/people/permissions/module/search_api_autocomplete
. - Go to
/admin/config/development/configuration/single/export
and export the config for the Content editor role.
In the last step, I see the following dependencies:
dependencies: config: - node.type.article - node.type.page - search_api_autocomplete.search.search_content - taxonomy.vocabulary.tags module: - comment - contextual - file - node - path - search_api_autocomplete - system - taxonomy - toolbar
That is, the role correctly depends on the
search_api_autocomplete.search.search_content
configuration. - πΊπΈUnited States benjifisher Boston area
To complete the test,
- Switch to the 8.x-1.x branch.
- Remove the permission from the Content editor role.
- Clear caches.
- Restore the permission.
- Export the role config.
Now I see these dependencies:
dependencies: config: - node.type.article - node.type.page - taxonomy.vocabulary.tags module: - comment - contextual - file - node - path - search_api_autocomplete - system - taxonomy - toolbar
The module is listed but not the search config.
- πΊπΈUnited States benjifisher Boston area
@drunkenmonkey:
Please consider giving issue credit to those who commented on π "Adding non-existent permissions to a role is not allowed." exception is thrown for profile installations Needs work : @codebymikey and @smustgrave.
- π¦πΉAustria drunken monkey Vienna, Austria
drunken monkey β made their first commit to this issueβs fork.
- last update
10 months ago 34 pass - π¦πΉAustria drunken monkey Vienna, Austria
Thanks a lot for reporting this problem and already providing the correct fix!
Seems this has been available for ages (since Drupal 9.3), so should be no problem increasing our version requirement to that. Anyone still on 9.2 is hardly gonna keep this module up to date.
Iβve also added a one-line test to make sure this works correctly.Please test/review and I can merge.
- Status changed to RTBC
10 months ago 5:59pm 4 February 2024 - πΊπΈUnited States benjifisher Boston area
@drunken monkey:
Thanks for catching the version requirement. BTW, Drupal 9.3 also introduced the module-specific permissions form that I mentioned in Step 4 of my testing instructions (Comment #3).
I reviewed the changes, and they look good. To keep myself honest, I checked the test to see where the magic string "muh" is introduced.
I repeated the test from Comment #3 and got the same result.
The other issue brought this bug to my attention. Reporting a bug is an important step in getting it fixed, even though the initial analysis was incomplete. I reviewed the issue that introduced permission dependencies, and I wrote the change record, so I did not need much help in figuring it out.
- last update
10 months ago 34 pass - last update
10 months ago 34 pass -
drunken monkey β
committed 9313a41e on 8.x-1.x authored by
benjifisher β
Issue #3416842 by benjifisher, drunken monkey: Added proper dependency...
-
drunken monkey β
committed 9313a41e on 8.x-1.x authored by
benjifisher β
- Status changed to Fixed
10 months ago 4:11pm 6 February 2024 - π¦πΉAustria drunken monkey Vienna, Austria
Good to hear, thanks for reporting back!
Merged. Thanks again! Automatically closed - issue fixed for 2 weeks with no activity.