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

lucascaro’s picture

I 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!

lucascaro’s picture

Category: bug » feature

Also, I'd set this as a feature request :)

ludo.r’s picture

Title: Match machine names and permission names for basic system permissions » Display permission machine name on permission page
Version: 7.12 » 7.x-dev
Priority: Minor » Normal

This is true not only for core but also for contributed modules that define their own permissions

And 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. ;)

mthomas’s picture

+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/...

aytee’s picture

Issue summary: View changes

Yes, 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.

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.