node.module, line 1505
The node_permission() function defines permissions: e.g. "View published content" with the machine name "access content".
I'm guessing that "access content" is legacy, and "View published content" is much clearer for a site admin. However it's a little confusing for (new) module developers that the displayed permission names don't match what you need to put in the access arguments array.
Maybe the official names could be displayed alongside in the Permissions page when the two values differ? Or the proper values could be listed in the API/documenation.
Comments
Comment #1
lucascaro commentedI agree that having the machine names for permissions accessible from the administration interface would be a major plus for module developers. This is true not only for core but also for contributed modules that define their own permissions, so what about adding the machine name somewere below the human name for permissions?
Maybe a good place would be below the human name (title) where the description is. What do you think?
If enough people agree on this, I can provide patches and tests for this issue.
Thanks!
Comment #2
lucascaro commentedAlso, I'd set this as a feature request :)
Comment #3
ludo.rAnd some modules have dynamic permissions.
E.g. Content module which creates a new set of permissions for each content type.
I totally agree with that!
It could be an option to enable so that regular users are not bothered with dev shit. ;)
Comment #4
mthomas commented+1. This is incredibly annoying, notice that some permissions match their titles, some do not: https://api.drupal.org/api/drupal/modules%21node%21node.module/function/...
Comment #5
aytee commentedYes, this issue is old, but still open and unresolved. There's a solution in the Devel module for this feature. Enable "Display machine names of permissions and modules" option and the permission machine name will show on hover on the permissions page.