content_moderation_roles
Content Moderation Roles gives site editors and administrators fine-grained control over which moderation states each role can see and set — on node forms and in admin content listing views — all without writing code.
By default, Drupal's Content Moderation module shows every workflow state to every user who can edit content. This module solves that: a "Contributor" can be limited to Draft and Needs Review, while an "Editor" sees all states including Published and Archived. All rules are managed through an admin UI and stored in config, making them fully deployable across environments.
Use case
A common scenario is when all user roles can create and edit all content types, but should be restricted to different workflow states depending on their responsibilities. For example, a "Contributor" role can be limited to Draft and Needs Review, while an "Editor" role has access to all states including Published and Archived. This module lets you configure those restrictions through the admin UI without writing any custom code.
Features
- Role-based state filtering on node forms — the moderation state dropdown on node add/edit forms is automatically trimmed to only the states the current user's role is allowed to set.
- Per content-type overrides — a role can have different allowed states depending on the content type being edited (e.g. an "Editor" role can publish Articles but only draft Events).
-
Multiple role support — users with multiple roles receive the union of their permitted states across all assigned roles.
Full-access role bypass — nominated roles (e.g. Administrator) skip all restrictions entirely. - Fallback restricted states — a global fallback state list applies to any role not explicitly configured in the matrix.
- Views query alteration — content listing views (e.g. "Content For Review") can be restricted so users only see content types their role has elevated access to.
- Layout Builder sort fix — an optional query alteration corrects the sort order for "My Content"-style views when Layout Builder pending revisions are in use, since core does not update node_field_data.changed for pending revisions.
- Fully config-driven — all rules live in content_moderation_roles.settings YAML config; no code changes needed and everything is deployable via config export/import.
Post-Installation
After enabling the module, go to Administration → Configuration → Workflow → Content Moderation Roles (/admin/config/workflow/content-moderation-roles). Requires the administer content moderation roles permission.
Configure:
- Full access roles — roles that see every state on every content type (typically Administrator).
- Fallback restricted states — states shown to any role with no explicit entry in the matrix.
- Per-role configuration — default allowed states per role, with optional per content-type overrides.
- Views map — view_id:display_id pairs (one per line) mapping Views displays to the sort correction or content restriction query alterations.
No database schema is created. All configuration is stored as standard Drupal config and can be exported with drush cex and deployed normally.
Additional Requirements
All dependencies are Drupal core modules — no additional downloads required:
- Content Moderation
(drupal:content_moderation)— provides the workflow and state system. - Node
(drupal:node)— state filtering is applied to node forms. - Views
(drupal:views)— required for view query alteration features.
Recommended modules/libraries
- Workflows (Drupal core) — used to populate the list of available moderation states in the admin UI. Enabled automatically with Content Moderation.
- Layout Builder (Drupal core) — if you use Layout Builder, enable the Views sort correction in the Views map to ensure pending revisions sort correctly in content listing views.
Supporting this Module
Contributions are welcome via the issue queue on drupal.org. If you find a bug or have a feature request, please open an issue with a clear description and steps to reproduce.
Community Documentation
Documentation is included in the module's README.md. Further walkthroughs and screencasts may be added here as the community grows.