Experimental project

This is a sandbox project, which contains experimental code for developer use only.

Mark content as restricted so a permission is needed to view it.

Each content type has a permission to view restricted nodes of that type. There is also a global View all restricted content permission.

Each content type may be set to always or never restricted, restricted by default, or not restricted by default. The first two options just apply globally. The second two create a checkbox on each node form, but control its default value differently.

This module aims to be easy to use, with just a few settings allowing access control on a per-content type and per-node basis.

The logic to make a node restricted is:

  • If the content type is set to always or never be restricted, that overrides any individual node.
  • If an individual node has a restricted option set, use that.
  • Otherwise, fall through to the default setting for the content type.

This module takes advantage of a new hook in Drupal 7, hook_node_access, to bypass the node access table entirely. This should be more performant, but also means no attempt is made to play nicely with other access control modules.

Project information