function drush_role_remove_perm

8.0.x role.drush.inc drush_role_remove_perm($rid, $permissions = NULL)
6.x role.drush.inc drush_role_remove_perm($rid, $permission = NULL)
7.x role.drush.inc drush_role_remove_perm($rid, $permissions = NULL)
master role.drush.inc drush_role_remove_perm($rid, $permissions = NULL)

Remove permission(s) from the specified role.

Parameters

string $rid machine name for a role:

null|string $permissions machine names, delimited by commas.:

Return value

bool

File

commands/core/role.drush.inc, line 191

Code

function drush_role_remove_perm($rid, $permissions = NULL) {
  if (is_null($permissions)) {
    // Assume --module is used thus inject a FALSE
    $perms = array(FALSE);
  }
  else {
    $perms = _convert_csv_to_array($permissions);
  }

  $removed_perm = FALSE;

  foreach ($perms as $perm) {
    $result = drush_role_perm('remove', $rid, $perm);
    if ($result !== FALSE) {
      $removed_perm = TRUE;
      drush_log(dt('Removed "!perm" from "!role"', array('!perm' => $perm, '!role' => $result->name)), LogLevel::OK);
    }
  }

  if ($removed_perm) {
    drush_drupal_cache_clear_all();
  }

  return $result;
}