How can I look up the valid access arguments? I looked in menu_router, but I believe that only gives some of them.
$items['admin/page'] = array(
'access arguments' => array('access administration pages'),
);
How can I look up the valid access arguments? I looked in menu_router, but I believe that only gives some of them.
$items['admin/page'] = array(
'access arguments' => array('access administration pages'),
);
Invoke
hook_permission()
across all modules:If I remember rightly
array_keys($permissions)
will then give you a list of valid permission machine names. The labels/descriptions/other settings for each permissions are in each individual array item.Actually, you are interested to the values of the access arguments where the access callback is "user_access" (the default value); as a module can use a different access callback, the values for the access arguments can theoretically be infinite.
The alternative to invoking all the implementations of
hook_permission()
is to use code similar to the following one:array_keys($permissions)
will then give you the list of all the permissions.I took the query from user_role_permissions(); the difference is that the function is interested in the permissions associated to the role passed as argument.
1- Check a list of valid permissions at: /admin/people/permissions
2- Specify the permission in your menu hook: