[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/xmlsitemap/xmlsitemap_node/ -> xmlsitemap_node.api.php (source)

   1  <?php
   2  // $Id: xmlsitemap_node.api.php,v 1.1.2.1 2010/04/29 04:42:29 davereid Exp $
   3  
   4  /**
   5   * @file
   6   * Hooks provided by the XML sitemap node module.
   7   *
   8   * @ingroup xmlsitemap
   9   */
  10  
  11  /**
  12   * @addtogroup hooks
  13   * @{
  14   */
  15  
  16  /**
  17   * Alter user access rules when trying to view, edit or delete a node.
  18   *
  19   * Node access modules establish rules for user access to content.
  20   * hook_node_grants() defines permissions for a user to view, edit or delete
  21   * nodes by building a $grants array that indicates the permissions assigned to
  22   * the user by each node access module. This hook is called to allow modules to
  23   * modify the $grants array by reference, so the interaction of multiple node
  24   * access modules can be altered or advanced business logic can be applied.
  25   *
  26   * This is a backport of the hook with the same name in Drupal 7 core. If this
  27   * hook is invoked to determine if the anonymous user can access a node
  28   * regardless of context, the $account->xmlsitemap_node_access will be TRUE.
  29   *
  30   * @param &$grants
  31   *   The $grants array returned by hook_node_grants().
  32   * @param $account
  33   *   The user account requesting access to content.
  34   * @param $op
  35   *   The operation being performed, 'view', 'update' or 'delete'.
  36   *
  37   * @see hook_node_grants()
  38   */
  39  function hook_node_grants_alter(&$grants, $account, $op) {
  40    if (!empty($account->xmlsitemap_node_access)) {
  41      unset($grants['vocabulary']);
  42    }
  43  }
  44  
  45  /**
  46   * @} End of "addtogroup hooks".
  47   */


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7