Problem/Motivation
This module hardcodes logic for allowed transitions:
$user = \Drupal::currentUser();
$user_transitions = array_filter($type_plugin->getTransitions(), function (Transition $transition) use ($workflow, $user) {
return $user->hasPermission('use ' . $workflow->id() . ' transition ' . $transition->id());
});
It should invoke \Drupal\content_moderation\StateTransitionValidationInterface::getValidTransitions
We've made it so that administer * permissions allow using transitions. But this module has its logic hardcoded.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #3
mglamanI believe this uncovered bugs in the tests.
This is failing. But
draft -> archivewas never a valid transition. Fromdraftonlycreate_new_draftandpublishare valid.EDIT: Ah but the possible valid ones need to be considered if it's schedule to be unpublished after being published...
Comment #4
jonathan1055 commentedThanks for this, @mglaman.
Moving to the 3.x branch as it would have to be done there first. Open a new MR, as we can use MR48 if it gets back-ported to 2.x
Comment #7
smustgrave commentedGot this working!