You are here

public function PermissionEvent::hasGroupContentOperationPermission in Organic groups 8

Returns if a group content operation permission matches given properties.

Parameters

string $entity_type_id: The group content entity type ID to which this permission applies.

string $bundle_id: The group content bundle ID to which this permission applies.

string $operation: The entity operation to which this permission applies.

bool $owner: Set to FALSE if this permission applies to all entities, or to TRUE if it only applies to the ones owned by the user. Defaults to FALSE.

Return value

bool Whether or not the permission exists.

Overrides PermissionEventInterface::hasGroupContentOperationPermission

File

src/Event/PermissionEvent.php, line 181

Class

PermissionEvent
Event that is fired when OG permissions are compiled.

Namespace

Drupal\og\Event

Code

public function hasGroupContentOperationPermission($entity_type_id, $bundle_id, $operation, $owner = FALSE) {
  try {
    $this
      ->getGroupContentOperationPermission($entity_type_id, $bundle_id, $operation, $owner);
  } catch (\InvalidArgumentException $e) {
    return FALSE;
  }
  return TRUE;
}