public function StateChange::access in Workbench Moderation Actions 8
Same name in this branch
- 8 src/Controller/StateChange.php \Drupal\workbench_moderation_actions\Controller\StateChange::access()
- 8 src/Plugin/Action/StateChange.php \Drupal\workbench_moderation_actions\Plugin\Action\StateChange::access()
Ensures the user is allowed to make the transition on the entity.
1 string reference to 'StateChange::access'
File
- src/
Controller/ StateChange.php, line 72
Class
- StateChange
- Performs the state change, if user has access to do it.
Namespace
Drupal\workbench_moderation_actions\ControllerCode
public function access($entity_type_id, $entity_id, $from, $to) {
return AccessResult::allowedIf($this->validation
->userMayTransition($from, $to, $this
->currentUser()))
->cachePerPermissions();
}