Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Entity Access by Role Field

2,098 sites Security covered Drupal 10–11 Entity ecosystem
View on drupal.org

This module adds a role-based access control field to entities, allowing you to specify which roles can view, edit, or delete them. It provides flexible configuration for allowed operations and fallback behavior, and can optionally grant access to unpublished content.

Feature Overview

  • Provides a "Role access" field to determine access permissions per fielded entity by selected roles
  • Selected roles can be allowed or denied access per entity
  • Fallback behavior, if no role is selected, can be defined per field
  • Entity access can be defined by allowed operation (view,edit,delete)
  • Setting "View Unpublished" also allows access on unpublished entities if desired
  • Access check can be skipped by global permission for permitted roles

Initially based on Entity Access by Role by Shamrockonov. Thank you very very much, @Shamrockonov. We finally decided to split this module off.

Reasons for split-off-fork:

We decided to split this module of due to large code refactorings and missing maintainer response. Perhaps this will one day land in a 2.x entity_access_by_role module, but due to changes in the field schema the upgrade path might become complicated.

Screenshots

Field Settings:

Widget Settings:

Views support

This module implements hook_entity_access() to dynamically calculate entity access permissions. Due to the complex logic it doesn't implement hook_query_TAG_alter().
So Views may display entities, which are "Access denied" for the users! Take care, in some combination this may lead to information disclosure for such Views contents (e.g. seeing the label you should not see).

Until the core issue (#777578: Add an entity query access API and deprecate hook_query_ENTITY_TYPE_access_alter()) is fixed, you may try the views_entity_access_check module if you're running into such cases:
https://www.drupal.org/project/views_entity_access_check
And please help to push a core solution in the linked issue.

Debugging permissions / entity access

For debugging permissions on entities, the following modules can be helpful:

  1. Devel
  2. Web Profiler
  3. Drush Tools
  4. Masquerade

Alternative modules:

Need to define access based on referenced entities instead?

Try our Entity Access by Reference Field module, which is based on the code and knowledge from this module to implement functionality similar to what we knew from Node access node reference and Node access user reference but that have no Drupal 8+ release.

Supporting this module

Support DROWL's ♥ FOSS work on this module on OpenCollective!

Drupal and this module are FOSS. However, it takes dedicated people to develop and maintain. And they need YOU to give back!

We're committed to building and maintaining Drupal modules that benefit the entire community.

Supporting us on OpenCollective helps us continue to improve, innovate and contribute to Drupal's future. Every pledge makes a difference!

If this module has helped you, we would be very grateful for your donation to support its further development and maintenance.

Support our FOSS development ♥️

You can also speed up the development of features or bugfixes you'd love to see, by sponsoring and giving back!

Sponsor a feature or bugfix 🚀

Let's make Drupal even better, together!

Development proudly sponsored by German Drupal Friends & Companies:

webks: websolutions kept simple (https://www.webks.de)
and
DROWL: Drupalbasierte Lösungen aus Ostwestfalen-Lippe (OWL), Germany (https://www.drowl.de)

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Jan 2026
Latest release
7 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Core Release date
2.0.6 Stable 10–11 Jan 12, 2026