You are here

protected function EntityPermissionProviderBase::processPermissions in Entity API 8

Adds the provider and converts the titles to strings to allow sorting.

Parameters

array $permissions: The array of permissions.

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type.

Return value

array An array of processed permissions.

1 call to EntityPermissionProviderBase::processPermissions()
EntityPermissionProviderBase::buildPermissions in src/EntityPermissionProviderBase.php
Builds permissions for the given entity type.

File

src/EntityPermissionProviderBase.php, line 96

Class

EntityPermissionProviderBase
@internal

Namespace

Drupal\entity

Code

protected function processPermissions(array $permissions, EntityTypeInterface $entity_type) {
  foreach ($permissions as $name => $permission) {

    // Permissions are grouped by provider on admin/people/permissions.
    $permissions[$name]['provider'] = $entity_type
      ->getProvider();

    // TranslatableMarkup objects don't sort properly.
    $permissions[$name]['title'] = (string) $permission['title'];
  }
  return $permissions;
}