This project is not covered by Drupal’s security advisory policy.
The Premium Content Access Permissions By Term module allows access to content to be restricted to certain roles by taxonomy term and Drupal role permissions and supports multiple access tiers.
It does not use the node_access table. It integrates with views via its use of taxonomy terms. It is similar but different to the Taxonomy Access Control, TAC Lite, Restricted Content and Premium modules.
When access is denied to a content item it supports redirecting the user to another path, or giving them the access denied page. Support for more behaviors can be added reasonably easily.
Installation instructions
- Create a vocabulary for the access levels. A suitable name for the vocabulary is "Restrict access to". It must not be hierarchical or multiple. It can be required if you want, though this is usually not recommended.
- Enable the vocabulary for at least one node type for which access can be restricted.
- Create one term for each premium level. You don't need a term for "all users can access", since if a node has no access-level term set, then access control falls through to the "access content" permission.
- Add the following line to the end of settings.php and change
123
to the ID of the vocabulary you created;
$conf['pcapbt_vocabulary_id'] = 123;
- If you want to redirect users to a page where they can promote themselves (e.g. by registering or purchasing a role), then add the following lines to the end of settings.php;
$conf['pcapbt_actions'] = array( 456 => array( 'behavior' => 'redirect', 'path' => 'user/login', ), 789 => array( 'behavior' => 'redirect', 'path' => 'node/1', ), );
- Change
456
and789
to the term IDs for the access level terms you created. Changeuser/login
andnode/1
to the Drupal system paths that users should be redirected to when they need to upgrade their account. If you don't configure any settings for a term, then it will simply return the 403 access denied content. Currently only theredirect
behavior is supported, more behaviors can be added in the module, such asteaser
,callback function
,view
,panel
. - On the permissions page you can now set access permissions for each role and term you created.
Important Note
If you change a term name you will need to reconfigure permissions. This is a bug that needs to be fixed, by form_alter
ing the permissions form so that the permission string uses the term ID, but the UI uses the term name.
Project information
- Unsupported
Not supported (i.e. abandoned), and no longer being developed. Learn more about dealing with unsupported (abandoned) projects - Obsolete
Use of this project is deprecated. - Module categories: Site Structure, Access Control
- Created by Bevan on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.