Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Simple NodeAccess

Security covered Maintenance fixes only

This module provides simple node access control by allowing administrators to configure which roles can view, edit, or delete specific nodes. It is designed for performance and does not affect how nodes appear in listings like views. Access restrictions only apply to direct access to node pages.

Simple Node Access is a extremely simple module is focused on simplicity and performance.

It relies on hook_node_access + a simple configuration, maintaining the node_access tables untouched.

This works only on view/edit/delete pages, so nodes under access control won't be excluded from listings, like views.

Usage

The module is configured exclusively through a configuration entity. Edit this entity to change configuration.

To edit the entity run:

drush cedit simple_nodeaccess.settings

An editor will appear with the current content. On each role and operation you will be able to add a list of nodes that will be authorized/forbidden access.

The entity default config is:

anonymous:
  allowed_on:
    delete: { }
    update: { }
    view: { }
  forbidden_on:
    delete: { }
    update: { }
    view:
      - 25
authenticated:
  allowed_on:
    delete: { }
    update: { }
    view: { }
  forbidden_on:
    delete: { }
    update:
      - 26
    view: { }
administrator:
  allowed_on:
    delete:
      - 30
    update:
      - 30
    view: { }
  forbidden_on:
    delete: { }
    update: { }
    view: { }

If you want to forbid access to node 101 and 102 to anonymous users edit the configuration entity accordingly. For example, the anonymous role part can be:

...
anonymous:
  allowed_on:
    delete: {  }
    update: {  }
    view: {  }
  forbidden_on:
    delete: {  }
    update: {  }
    view:
      - 101
      - 102
---

Notice

As said above, this only applies on certain situations like direct access to a node page. Don't rely on this module you must forbid access to some content at any cost.

Ask your assistant about Simple NodeAccess

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

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
Aug 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
1.0.0-rc1 Pre-release 9–10 Aug 12, 2023