function RoleListBuilder::getDefaultOperations

Same name in other branches
  1. 9 core/modules/user/src/RoleListBuilder.php \Drupal\user\RoleListBuilder::getDefaultOperations()
  2. 8.9.x core/modules/user/src/RoleListBuilder.php \Drupal\user\RoleListBuilder::getDefaultOperations()
  3. 10 core/modules/user/src/RoleListBuilder.php \Drupal\user\RoleListBuilder::getDefaultOperations()

Overrides ConfigEntityListBuilder::getDefaultOperations

File

core/modules/user/src/RoleListBuilder.php, line 83

Class

RoleListBuilder
Defines a class to build a listing of user role entities.

Namespace

Drupal\user

Code

public function getDefaultOperations(EntityInterface $entity) {
    $operations = parent::getDefaultOperations($entity);
    if ($entity->hasLinkTemplate('edit-permissions-form')) {
        $operations['permissions'] = [
            'title' => $this->t('Edit permissions'),
            'weight' => 20,
            'url' => $entity->toUrl('edit-permissions-form'),
        ];
    }
    return $operations;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.