Drupal is a registered trademark of Dries Buytaert

node_access_by_field_role

1 sites No security coverage
View on drupal.org

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.

Activity

Total releases
2
First release
Sep 2025
Latest release
6 months ago
Release cadence
0 days
Stability
100% stable

Releases

Version Type Release date
1.0.1 Stable Sep 2, 2025
1.0.0 Stable Sep 2, 2025