node_access_example_node_access_explain

Versions
7
node_access_example_node_access_explain($row)

Implementation of hook_node_access_explain().

hook_node_access_explain() is defined in devel_node_access.module, which will help you and your users to figure out how node access works.

The explanations are purposely not translatable to allow getting support on drupal.org.

Code

developer/examples/node_access_example.module, line 167

<?php
function node_access_example_node_access_explain($row) {
  switch ($row->realm) {
    case 'example':
      return array('Users with <i>access private content</i> (<i>' . (user_access('access private content')? 'yes' : 'no') . '</i>) may view and users with <i>edit private content</i> (<i>' . (user_access('edit private content')? 'yes' : 'no') . '</i>) may edit this node.');
      break;
    case 'example_author':
      return array("Full access for the author, user <i>$row->gid</i>.");
      break;
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.