- Issue created by @tarawij
- Merge request !98Issue #3533308: Add a dedicated 'administer book settings' permission for Book module settings page β (Open) created by tarawij
- π¦πΊAustralia tarawij
I've pushed an initial patch to the issue fork branch 3533308-add-a-dedicated-permission.
This patch introduces a new administer book settings permission and updates the route access for the Book moduleβs settings page (/admin/structure/book/settings) to use it, replacing the broader administer site configuration permission.
It also includes a functional test (BookSettingsAccessTest) to verify access for users with and without the new permission.
This patch does not include an update hook, so sites will need to assign the new permission to roles manually.
Kindly requesting a review when convenient, happy to revise or expand on the patch as needed. Thank you!
- π¦πΊAustralia tarawij
Updated the patch to include an update hook for backward compatibility.
Added `book_update_103007()` which automatically grants the new 'administer book settings' permission to existing roles that have 'administer site configuration'. This ensures no access disruptions during upgrades.
The patch now provides a complete solution with automatic permission migration for existing sites.
I have reviewed and tested the patch. After applying it and running 'drush updatedb', a new 'Administer book settings' permission appears. This permission allows access to the book settings page at '/admin/structure/book/settings'.
Users who already have the 'Administer site configuration' permission are automatically granted the new 'Administer book settings' permission.
Test environment:
Local vanilla GovCMS site
Drupal Core: 11.2.1
drupal/book: 3.0.0-alpha2Reviewed this, looks good, has update hook and tests, works as expected. Moving to RTBC