You are here

public function GroupRoleListBuilder::getDefaultOperations in Group 2.0.x

Same name and namespace in other branches
  1. 8 src/Entity/Controller/GroupRoleListBuilder.php \Drupal\group\Entity\Controller\GroupRoleListBuilder::getDefaultOperations()

Gets this list's default operations.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity the operations are for.

Return value

array The array structure is identical to the return value of self::getOperations().

Overrides ConfigEntityListBuilder::getDefaultOperations

File

src/Entity/Controller/GroupRoleListBuilder.php, line 101

Class

GroupRoleListBuilder
Defines a class to build a listing of group role entities.

Namespace

Drupal\group\Entity\Controller

Code

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