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.

Supporting organizations: 

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • Project categories: Access control
  • Created by akalam on , updated
  • shieldStable releases for this project are covered by the security advisory policy.
    There are currently no supported stable releases.

Releases