X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcontent_moderation%2Fsrc%2FStateTransitionValidationInterface.php;fp=web%2Fcore%2Fmodules%2Fcontent_moderation%2Fsrc%2FStateTransitionValidationInterface.php;h=c793fe53e275309ae53d60557a3d1e94c7bce525;hp=1acbf052fd064607aa015bfa94a7fcab83d9564c;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/content_moderation/src/StateTransitionValidationInterface.php b/web/core/modules/content_moderation/src/StateTransitionValidationInterface.php index 1acbf052f..c793fe53e 100644 --- a/web/core/modules/content_moderation/src/StateTransitionValidationInterface.php +++ b/web/core/modules/content_moderation/src/StateTransitionValidationInterface.php @@ -4,6 +4,8 @@ namespace Drupal\content_moderation; use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\workflows\StateInterface; +use Drupal\workflows\WorkflowInterface; /** * Validates whether a certain state transition is allowed. @@ -23,4 +25,21 @@ interface StateTransitionValidationInterface { */ public function getValidTransitions(ContentEntityInterface $entity, AccountInterface $user); + /** + * Checks if a transition between two states if valid for the given user. + * + * @param \Drupal\workflows\WorkflowInterface $workflow + * The workflow entity. + * @param \Drupal\workflows\StateInterface $original_state + * The original workflow state. + * @param \Drupal\workflows\StateInterface $new_state + * The new workflow state. + * @param \Drupal\Core\Session\AccountInterface $user + * The user to validate. + * + * @return bool + * Returns TRUE if transition is valid, otherwise FALSE. + */ + public function isTransitionValid(WorkflowInterface $workflow, StateInterface $original_state, StateInterface $new_state, AccountInterface $user); + }