You are here

public function PermissionManager::getDefaultPermissions in Organic groups 8

Returns the full set of default permissions for a group and its content.

This returns both group level permissions such as 'subscribe without approval' and group content entity operation permissions such as 'edit own article content'.

Parameters

string $group_entity_type_id: The entity type ID of the group for which to return permissions.

string $group_bundle_id: The bundle ID of the group for which to return permissions.

array $group_content_bundle_ids: An array of group content bundle IDs, keyed by group content entity type ID.

string|null $role_name: Optional default role name to filter the permissions on. If omitted, all permissions will be returned.

Return value

\Drupal\og\PermissionInterface[] The array of permissions.

Overrides PermissionManagerInterface::getDefaultPermissions

2 calls to PermissionManager::getDefaultPermissions()
PermissionManager::getDefaultEntityOperationPermissions in src/PermissionManager.php
Returns the list of entity operation permissions for a given group content.
PermissionManager::getDefaultGroupPermissions in src/PermissionManager.php
Returns permissions that are enabled by default for the given role.

File

src/PermissionManager.php, line 36

Class

PermissionManager
Manager for OG permissions.

Namespace

Drupal\og

Code

public function getDefaultPermissions($group_entity_type_id, $group_bundle_id, array $group_content_bundle_ids, $role_name = NULL) {
  $event = new PermissionEvent($group_entity_type_id, $group_bundle_id, $group_content_bundle_ids);
  $this->eventDispatcher
    ->dispatch(PermissionEventInterface::EVENT_NAME, $event);
  return $event
    ->getPermissions();
}