You are here

public function OgRoleManagerInterface::getRolesByPermissions in Organic groups 8

Returns all the roles that have a specific permission.

Optionally filter the roles by entity type ID and bundle.

Parameters

array $permissions: An array of permissions that the roles must have.

string $entity_type_id: (optional) The entity type ID of the group.

string $bundle: (optional) The bundle of the group.

bool $require_all: (optional) Whether all given permissions are required. When set to FALSE all roles that include one or more of the given permissions will be returned. Defaults to TRUE.

Return value

\Drupal\og\OgRoleInterface[] An array of roles indexed by their IDs.

1 method overrides OgRoleManagerInterface::getRolesByPermissions()
OgRoleManager::getRolesByPermissions in src/OgRoleManager.php
Returns all the roles that have a specific permission.

File

src/OgRoleManagerInterface.php, line 82

Class

OgRoleManagerInterface
Defines an interface for OG role manager.

Namespace

Drupal\og

Code

public function getRolesByPermissions(array $permissions, $entity_type_id = NULL, $bundle = NULL, $require_all = TRUE) : array;