public function RoleListController::getOperations

Overrides \Drupal\Core\Entity\EntityListController::getOperations();

Overrides ConfigEntityListController::getOperations

File

drupal/core/modules/user/lib/Drupal/user/RoleListController.php, line 40
Contains \Drupal\user\RoleListController.

Class

RoleListController
Provides a listing of user roles.

Namespace

Drupal\user

Code

public function getOperations(EntityInterface $entity) {
  $operations = parent::getOperations($entity);
  $operations['permissions'] = array(
    'title' => t('Edit permissions'),
    'href' => 'admin/people/permissions/' . $entity
      ->id(),
    'weight' => 20,
  );

  // Built-in roles could not be deleted or disabled.
  if (in_array($entity
    ->id(), array(
    DRUPAL_ANONYMOUS_RID,
    DRUPAL_AUTHENTICATED_RID,
  ))) {
    unset($operations['delete']);
  }
  return $operations;
}