Last active
March 7, 2018 11:03
-
-
Save dasginganinja/ed1acf67d0c4dd0226d9 to your computer and use it in GitHub Desktop.
Drupal 7 Drush Command to Grant All Permission to A Role
This file contains 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 | |
// Get the Role ID we want to add all permissions to | |
$rid = user_role_load_by_name('Super Administrator')->rid; | |
// Get a listing of all of the permissions | |
$perms = array_keys(user_permission_get_modules()); | |
// Grant permissions for the role | |
user_role_grant_permissions($rid, $perms); |
This file contains 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
drush eval "user_role_grant_permissions(user_role_load_by_name('Super Administrator')->rid, array_keys(user_permission_get_modules()));" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment