You are here

protected function SimpleAccessPermissions::buildPermissions in Simple Access 8.3

Returns a list of node permissions for a given node type.

Parameters

\Drupal\node\Entity\NodeType $type: The node type.

Return value

array An associative array of permission names and descriptions.

1 call to SimpleAccessPermissions::buildPermissions()
SimpleAccessPermissions::nodeTypePermissions in src/SimpleAccessPermissions.php
Returns an array of node type permissions.

File

src/SimpleAccessPermissions.php, line 39

Class

SimpleAccessPermissions

Namespace

Drupal\simple_access

Code

protected function buildPermissions(NodeType $type) {
  $type_id = $type
    ->id();
  $type_params = [
    '%type_name' => $type
      ->label(),
  ];
  return [
    "assign groups to {$type_id} nodes" => [
      'title' => $this
        ->t('%type_name: Assign groups', $type_params),
    ],
    "assign profiles to {$type_id} nodes" => [
      'title' => $this
        ->t('%type_name: Assign profiles', $type_params),
    ],
    "assign owner permissions for {$type_id}" => [
      'title' => $this
        ->t('%type_name: Assign owner permissions', $type_params),
    ],
  ];
}