You are here

public function NodeAuthlinkPermissions::permissions in Node authorize link 8

Permissions callback to granularize node authlink.

1 string reference to 'NodeAuthlinkPermissions::permissions'
node_authlink.permissions.yml in ./node_authlink.permissions.yml
node_authlink.permissions.yml

File

src/NodeAuthlinkPermissions.php, line 45

Class

NodeAuthlinkPermissions
Node authlink permissions generator.

Namespace

Drupal\node_authlink

Code

public function permissions() {
  $permissions = [];
  foreach ($this->entityTypeManager
    ->getStorage('node_type')
    ->loadMultiple() as $nodeType) {
    $permission_name = sprintf('create and delete node %s authlinks', $nodeType
      ->id());
    $permissions[$permission_name] = [
      'title' => $this
        ->t('Create and delete node "@node_type" authlinks', [
        '@node_type' => $nodeType
          ->label(),
      ]),
    ];
  }
  return $permissions;
}