18.10.2016 Views

Drupal 7 Module Development

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 9<br />

In the preceding case, the user dutiwrecl has been granted editing permissions<br />

by the node module. Other users may view the content because a node access<br />

module (in this case Domain Access, http://drupal.org/project/domain)<br />

has granted access.<br />

If you review our discussion of how the node_access() function operates, you can<br />

quickly see how handy this developer's utility can be.<br />

Summary<br />

This has been a long chapter, and we hope you found it rewarding. Understanding<br />

and using node access is one of the most powerful tools in the <strong>Drupal</strong> API. We have<br />

covered a wide array of topics, but the key points to remember are:<br />

• How access to a node is determined<br />

• To always use dynamic query syntax for node lists and to tag node queries<br />

with add_tag('node_access')<br />

• The differences between hook_node_access() and writing a node<br />

access module<br />

• How to alter Create, View, Update and Delete access to individual nodes<br />

• The three major operations controlled by the Node Access API<br />

• How to filter listing queries using the Node Access API<br />

[ 285 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!