Role7.php

  1. 8.0.x lib/Drush/Role/Role7.php
  2. 7.x lib/Drush/Role/Role7.php
  3. master lib/Drush/Role/Role7.php

Namespace

Drush\Role

Classes

Namesort descending Description
Role7

File

lib/Drush/Role/Role7.php
View source
  1. <?php
  2. namespace Drush\Role;
  3. class Role7 extends RoleBase {
  4. public function getPerms() {
  5. $perms = user_role_permissions(array($this->rid => $this->name));
  6. return array_keys($perms[$this->rid]);
  7. }
  8. public function getModulePerms($module) {
  9. $perms = module_invoke($module, 'permission');
  10. return $perms ? array_keys($perms) : array();
  11. }
  12. public function role_create($role_machine_name, $role_human_readable_name = '') {
  13. return user_role_save((object)array('name' => $role_machine_name));
  14. }
  15. public function delete() {
  16. user_role_delete($this->rid);
  17. }
  18. public function grant_permissions($perms) {
  19. return drush_op('user_role_grant_permissions', $this->rid, $perms);
  20. }
  21. public function revoke_permissions($perms) {
  22. return drush_op('user_role_revoke_permissions', $this->rid, $perms);
  23. }
  24. }