Created
January 27, 2015 01:25
-
-
Save segovia94/687f7f7d567543eab7a6 to your computer and use it in GitHub Desktop.
Get a list of Drupal permissions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Print a list of all set permissions. | |
// You can then copy the output from the website source code and paste it into a php array. | |
$user_roles = user_roles(); | |
$roles = user_role_permissions($user_roles); | |
foreach ($roles as $rid => $permissions) { | |
print "\n\n" . $user_roles[$rid] . "\n"; | |
foreach ($permissions as $permission => $bool) { | |
print "'" . $permission . "',\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment