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).

Node Access by Field Role

5 sites No security coverage Drupal 9–11
View on drupal.org

This module grants granular control over which users can view specific content nodes. It allows administrators to restrict access based on roles assigned in reference fields or by directly referencing individual users. This ensures that content is only visible to the intended audience, such as sales representatives seeing their assigned clients or developers viewing assigned tasks.

Summary:

Node Access by Field provides fine-grained node access control based on role reference fields and user reference fields.
It allows you to restrict visibility of nodes depending on who is assigned in specific fields or what roles are selected per node.

Features

  • Restrict node visibility per role using a "Role access" field (checkboxes with Drupal roles).
  • Restrict node visibility per user reference field: e.g. Developer role only sees nodes where field_developer matches the logged-in user.
  • Define global full-access roles and global deny roles.
  • Configure per-content-type settings with a flexible UI.
  • Works with Drupal’s native node access system, Views, and Search API.
  • Compatible with Drupal 9, 10 and 11.

Use cases:

  • CRM / Sales: Only the commercial assigned to a client (via field_comercial) can see that client’s node.
  • Issue tracking: Developers only see the issues where they are assigned in field_developer.
  • Knowledge base: Certain nodes in a "Data bank" content type are visible only to specific roles (support, managers, etc).

Post-Installation

  1. Enable the module (drush en node_access_by_field or via the Extend page).
  2. Go to Configuration → People → Node Access by Field (/admin/config/people/node_access_by_field) to configure global and per-bundle rules.
  3. To allow per-node restrictions, add the provided Role reference field to the desired content types.
  4. Clear caches (drush cr).
  5. Test with different users and roles.

Additional Requirements

  • No external libraries required.
  • Works with Drupal core only.
  • Views: to display node listings respecting the access rules.
  • Search API: access restrictions also apply to indexed results.

Depends on

Dependencies of the latest stable release

  • node Drupal core
  • user Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Sep 2025
Latest release
11 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Slowing

Releases

Version Type Core Release date
1.0.1 Stable 9–11 Sep 2, 2025
1.0.0 Stable 9–11 Sep 2, 2025