public function CustomPublishingOptionPermissions::permissions in Custom Publishing Options 8
Get permissions for Custom Publishing Options.
Return value
array Permissions array.
1 string reference to 'CustomPublishingOptionPermissions::permissions'
File
- src/
CustomPublishingOptionPermissions.php, line 44
Class
Namespace
Drupal\custom_pubCode
public function permissions() {
$permissions = [];
foreach ($this->entityTypeManager
->getStorage('custom_publishing_option')
->loadMultiple() as $machine_name => $publish_option) {
$permissions += [
'can set node publish state to ' . $publish_option
->id() => [
'title' => $this
->t('Can set node publish state to %type.', [
'%type' => $publish_option
->label(),
]),
],
];
}
return $permissions;
}