User login

Drupal is an open source content management platform

Equipped with a powerful blend of features, Drupal supports a variety of websites ranging from personal weblogs to large community-driven websites.

Powered by Drupal, an open source content management system

Drupal system node access

admin's picture

This text is automatically translated. That's just an example how your nodes will look like.

Node access system determines who and what can be done with certain nodes.

To determine the permissions for the node is used node_access ( ) This function first checks if the user has permission 'administer nodes' These users have unlimited access to all nodam. Then call hook hook_access ( ) in a module of the node (by default - node_content_access ( ) and the return value, TRUE or FALSE to allow or deny access. For example, this blog allows the module to always grant access to the author a blog, and the module book - always deny editing PHP pages.

If the "nodes" module does not interfere in the process of limiting access (returns NULL in hook_access ( ) then it uses the table 'node_access' All these modules are queried using the hook hook_node_grants ( ) and as a result of going to the list of identifiers of user permissions (grant IDs). This list is compared with the corresponding table on the grant ID. If the table is present Record with ID of the node or the ID of the node in the table is 0, then the access node (or nodam) is permitted. Note that this table is, in essence, is a list of permits, any matching lines enough to allow access to the node.

In the process of checking the lists of node access rules is somewhat different. hook_access ( ) is not called for each node due to low productivity of such an approach, as well as for the normal operation of pagers (listalki pages). Therefore, SQL-query to generate a list, should pass through the function db_rewrite_sql ( ) which means calls hooks hook_db_rewrite_sql ( ) will complement the validation request access.

How to write your own modules access - node_access_example.module.
 

Drupal is a free software package that allows an individual or a community of users to easily publish, manage and organize a wide variety of content on a website. Tens of thousands of people and organizations are using Drupal.

 

Poll

Do you like this theme?
Yes
48%
Nope!
7%
Where am I?
46%
Total votes: 546