You are here

public function GroupNodePermissionProvider::buildPermissions in Group 2.0.x

Provides a list of group permissions the plugin exposes.

If you have some group permissions that would only make sense when your plugin is installed, you may define those here. They will not be shown on the permission configuration form unless the plugin is installed.

Return value

array An array of group permissions, see GroupPermissionHandlerInterface for the structure of a group permission.

Overrides PermissionProviderTrait::buildPermissions

See also

GroupPermissionHandlerInterface::getPermissions()

File

modules/gnode/src/Plugin/Group/RelationHandler/GroupNodePermissionProvider.php, line 40

Class

GroupNodePermissionProvider
Provides group permissions for the group_node relation plugin.

Namespace

Drupal\gnode\Plugin\Group\RelationHandler

Code

public function buildPermissions() {
  $permissions = $this->parent
    ->buildPermissions();

  // Rename the view any unpublished entity permission.
  if ($name = $this->parent
    ->getPermission('view', 'entity', 'any')) {
    $permissions[$this
      ->getPermission('view', 'entity', 'any')] = $permissions[$name];
    unset($permissions[$name]);
  }
  return $permissions;
}