Problem/Motivation
There are several links to the Permissions page in implementations of hook_help()
and in Help Topics. The Permissions page is overwhelming, and we should avoid links to that page.
Steps to reproduce
Proposed resolution
Most of these links specify the relevant module as a fragment, like /people/permissions#module-module_name
. After #3216341: Provide a module-specific permissions form, we can replace these with links to the module-specific Permissions page, /admin/people/permissions/module/module_name
.
In some cases, we may want to deal with permissions from more than one module. If so, then we can provide a link to /admin/people/permissions/module/module_1,module_2
(two or more module machine names, separated by commas).
Remaining tasks
- Update the change record Permissions can be viewed and edited for one module or a list of modules.
User interface changes
Change many of the links in Help pages.
API changes
None
Data model changes
None
Release notes snippet
Issue fork drupal-3236443
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
benjifisherComment #4
paulocsComment #6
paulocsComment #7
benjifisher@paulocs:
Thanks for starting work on this issue!
The test failure is not surprising: the test looks for the link we are changing.
The change so far looks like it will update the links on
/admin/index
and/admin/help/{name}
. I did not think of those pages when I created the issue, so I am glad you did!There is still work to be done for the cases I had in mind: implementations of
hook_help()
, such astaxonomy_help()
intaxonomy.module
, and all the help topics undercore/modules/help_topics/help_topics/
.You can search that directory for help topics and
core/modules/*/*.module
for implementations ofhook_help()
. Or it might be easier to search all ofcore/modules
foruser.admin_permissions
.Some places will add the fragment in the
Url
constructor orUrl::fromRoute()
and others will add it withUrl::setOption()
after the object is created.You can get a head start on updating the tests by searching for
admin/people/permisisons
.Comment #8
paulocsComment #9
paulocsComment #10
gabriel.abdalla CreditAttribution: gabriel.abdalla at CI&T commentedHi, I reviewed the code and tested the links in each changed module help page.
Changes look good to me.
Comment #11
benjifisher@gabriel.abdalla:
Thanks for reviewing and testing.
I had a quick look at the changes in the MR, and they look right. When I first looked at the change in the
statistics
module, it looked broken, but that is just because GitLab (I guess) truncates long lines when viewing diffs "Inline". When I switched to "Side by side" mode, it showed me the actual change.A complete review should also say something about whether we have updated all the links. Did you search for
user.admin_permissions
to make sure we did not miss any?I also do not see any updates in the
help_topics
module. I mentioned this in the first line of the issue description and in #7.For example, in
core/modules/help_topics/help_topics/action.creating.html.twig
I see this line:If you change that to
and enable the
action
andhelp_topics
modules, then you will see an updated link on/admin/help/topic/action.creating
(Link text "Administer actions").Comment #12
paulocsComment #13
paulocsUpdated all links in
help_topic
module.I think that all links were replaced now. Please review.
Comment #14
benjifisherIf we can fix this issue in time for 9.3.0, then I think we can add this issue to the change record Permissions can be viewed and edited for one module or a list of modules. I am adding that to the list of remaining tasks in the issue summary.
Comment #15
marcos_lima CreditAttribution: marcos_lima at CI&T commentedHi Everyone. I reviewed the code, in the modules changed and in the help topics as well. Then tested it in every module and in every help topic changed too. As @benjifisher said in comment #11, I searched for
user.admin_permissions
and checked every mention of it. The patch changes made by @paulocs look good to me, except with the actions help topic, where the link to the permissions page in Administer Actions is not showing.To reproduce this, enable the help topics module, then go to the help page -> Configuring actions topic -> Creating an advanced action topic, and you can see that the “Administer Actions” link doesn’t show the way it should.
To solve that, you can change this line in
core/modules/help_topics/help_topics/action.creating.html.twig
:{% set action_permissions = render_var(help_route_link(action_permissions_link_text, 'user.admin_permissions.module', {'modules': 'module-action'})) %}
To:
{% set action_permissions = render_var(help_route_link(action_permissions_link_text, 'user.admin_permissions.module', {'modules': 'action'})) %}
All other help topics and module changes look good to me.
Comment #16
paulocsGood catch @marcos_lima! Thanks for the review.
Comment #17
paulocsAddressed #15.
Comment #18
marcos_lima CreditAttribution: marcos_lima at CI&T commentedThanks @paulocs! Everything looks good to me now.
Comment #19
paulocsI updated the change record as was suggested on comment #14.
See: https://www.drupal.org/node/3223123
Comment #20
alexpottCommitted de537bd and pushed to 9.3.x. Thanks!
I think everyone will appreciate not seeing masses of checkboxes in their dreams after configuring permissions on a Drupal site.