You are here

public function PermissionManagerInterface::getDefaultGroupPermissions in Organic groups 8

Returns permissions that are enabled by default for the given role.

This returns the group level permissions that are populated by default when a new group is created. For example the 'manage members' permission is granted by default to the administrator role, and the 'subscribe' permission to the anonymous role.

New default permissions can be added by creating an event listener for the PermissionEvent. The default permissions that ship with Organic Groups can be found in OgEventSubscriber::provideDefaultOgPermissions().

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.

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

Return value

\Drupal\og\GroupPermission[] An array of permissions that are enabled by default for the given role.

See also

\Drupal\og\Event\PermissionEventInterface

\Drupal\og\EventSubscriber\OgEventSubscriber::provideDefaultOgPermissions()

1 method overrides PermissionManagerInterface::getDefaultGroupPermissions()
PermissionManager::getDefaultGroupPermissions in src/PermissionManager.php
Returns permissions that are enabled by default for the given role.

File

src/PermissionManagerInterface.php, line 61

Class

PermissionManagerInterface
Interface for OG permission managers.

Namespace

Drupal\og

Code

public function getDefaultGroupPermissions($group_entity_type_id, $group_bundle_id, $role_name = NULL);