Required by role
This module makes certain fields conditionally required based on the user's role. You can configure specific roles to enforce a field's requirement, making it optional for users without those roles.
This module allows fields to only be required when the current user has a certain role. For example, you could keep a certain field optional when administrators need to change something about an entity and mark it as required when editors try to do so.
Post-Installation
After installing the module, visit the edit form of the field you want to change and under 'Choose a required strategy' choose 'Required by role'. Afterwards, you can choose which roles should make the field required.
Similar projects
- Required by Content Moderation state: allows fields to only be required when their associated entity reaches a certain Content Moderation state.
- CCK Required by Role: same functionality, but only for Content Construction Kit (CCK) entities on Drupal 7.
Depends on
Dependencies of the latest stable release
- Required API >3.0
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 2.0.0 | Stable | 10–11 | New stable release. | Jul 8, 2025 | |
| 2.0.0-beta3 | Pre-release | 10–11 | Fix 'TypeError: RequiredDefault::isRequired(): Return value must be of type bool, array returned'. | Feb 22, 2025 | |
| 2.0.0-beta2 | Pre-release | 10–11 | Fixes an issue with an update hook. | Dec 11, 2024 | |
| 2.0.0-beta1 | Pre-release | 10–11 | Adds support for Required API 3.0 & configuration schema. | Dec 9, 2024 | |
| 2.0.x-dev | Dev | 10–11 | Dec 5, 2024 | ||
| 8.x-1.3 | Stable | 8–11 | Add Drupal 11 compatibility. | Dec 5, 2024 |