public function Permissions::editPermissions in Workbench Moderation State Access 8
Returns an array of edit permissions.
Return value
array The edit permissions.
1 string reference to 'Permissions::editPermissions'
File
- src/
Permissions.php, line 21
Class
- Permissions
- Defines a class for dynamic permissions based on states.
Namespace
Drupal\workbench_moderation_state_accessCode
public function editPermissions() {
// @todo write a test for this.
$perms = [];
/* @var \Drupal\workbench_moderation\ModerationStateInterface $state */
foreach (ModerationState::loadMultiple() as $id => $state) {
$perms['edit content in the ' . $id . ' state'] = [
'title' => $this
->t('Edit content when in the %state_name state.', [
'%state_name' => $state
->label(),
]),
];
}
return $perms;
}