function drush_user_remove_role

8.0.x user.drush.inc drush_user_remove_role($role, $users = '')
6.x user.drush.inc drush_user_remove_role($role, $users = '')
7.x user.drush.inc drush_user_remove_role($role, $users = '')
4.x user.drush.inc drush_user_remove_role($role, $users = '')
5.x user.drush.inc drush_user_remove_role($role, $users = '')
master user.drush.inc drush_user_remove_role($role, $users = '')

Remove a role from the specified user accounts.

File

commands/user/user.drush.inc, line 291
Drush User Management commands

Code

function drush_user_remove_role($role, $users = '') {
  // If role is not found, an exception gets thrown and handled by command invoke.
  $role_object = drush_role_get_class($role);
  $userlist = new UserList($users);
  $userlist->each('removeRole', array($role_object->rid));
  drush_log(dt('Removed !role role from !users', array('!role' => $role, '!users' => $userlist->names())), LogLevel::SUCCESS);
}