0

I'm using Workflow module. I want to give permission to a specific role to edit the content moderation state. I found these on permissions page but it's not working. After I update the role permission, he got "Access Denied"

  • Are asking how to let them moderate the content (publish/unpublish) or how to let them manage moderation states? – mediaashley Jun 4 '18 at 9:05
  • I mean mange moderation state – Mohamed Osama Gbril Jun 4 '18 at 13:08
0

As far as I'm aware, there's no way to give permission to manage a specific state, nor workflow for that matter.

The only permission to cover these is administer workflows and it covers all workflows.

You can see this by looking the content_moderation.routing.yml

content_moderation.workflow_type_edit_form:
path: '/admin/config/workflow/workflows/manage/{workflow}/type/{entity_type_id}'
defaults:
  _form: '\Drupal\content_moderation\Form\ContentModerationConfigureEntityTypesForm'
  _title_callback: '\Drupal\content_moderation\Form\ContentModerationConfigureEntityTypesForm::getTitle'
requirements:
  _permission: 'administer workflows'

EDIT That is with the default permissions.

  • Thanks for clarifying. So is there any way of doing this by custom module? – Mohamed Osama Gbril Jun 5 '18 at 9:56
  • Can't say I've tried, but there look to be a number of options. Access to the page you need uses _entity_access: 'workflow.edit', so you could look at hook_entity_access (api.drupal.org/api/drupal/…), or this question: drupal.stackexchange.com/questions/81362/… – mediaashley Jun 5 '18 at 14:51
  • Have a look in workflow.routing.yml to check the appropriate routes and access controls. – mediaashley Jun 5 '18 at 14:52
  • Sorry, I've given administer workflows permission but still cannot edit the "closed" state – Mohamed Osama Gbril Jun 10 '18 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.