function RoleListBuilder::getDefaultOperations

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

Overrides ConfigEntityListBuilder::getDefaultOperations

File

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

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' => 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.