You are here

public function PermissionConfigurationHandler::onContentTypeLoad in Configuration Management 7.3

File

src/Handlers/PermissionConfigurationHandler.php, line 131

Class

PermissionConfigurationHandler

Namespace

Configuration\Handlers

Code

public function onContentTypeLoad($event) {
  $type = $this
    ->getInternalId($event->configuration
    ->getIdentifier());
  $node_list_permissions = array(
    "create {$type} content",
    "edit own {$type} content",
    "edit any {$type} content",
    "delete own {$type} content",
    "delete any {$type} content",
  );
  foreach ($node_list_permissions as $permission) {
    $id = preg_replace("/[^a-zA-Z0-9]+/", "_", $permission);
    $this->configuration_manager
      ->newDependency($event->configuration, 'permission.' . $id);
  }
}