You are here

public function PermissionProviderTrait::init in Group 2.0.x

File

src/Plugin/Group/RelationHandler/PermissionProviderTrait.php, line 52

Class

PermissionProviderTrait
Trait for group relation permission providers.

Namespace

Drupal\group\Plugin\Group\RelationHandler

Code

public function init($plugin_id, array $definition) {
  $this
    ->traitInit($plugin_id, $definition);
  $this->entityType = $this
    ->entityTypeManager()
    ->getDefinition($definition['entity_type_id']);
  $this->implementsOwnerInterface = $this->entityType
    ->entityClassImplements(EntityOwnerInterface::class);
  $this->implementsPublishedInterface = $this->entityType
    ->entityClassImplements(EntityPublishedInterface::class);
  $this->definesEntityPermissions = !empty($definition['entity_access']);
}