public function NodeAuthlinkPermissions::permissions in Node authorize link 8
Permissions callback to granularize node authlink.
1 string reference to 'NodeAuthlinkPermissions::permissions'
File
- src/
NodeAuthlinkPermissions.php, line 45
Class
- NodeAuthlinkPermissions
- Node authlink permissions generator.
Namespace
Drupal\node_authlinkCode
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;
}