You are here

function _subscriptions_content_access in Subscriptions 6

Same name and namespace in other branches
  1. 5.2 subscriptions_content.module \_subscriptions_content_access()
  2. 7 subscriptions_content.module \_subscriptions_content_access()
  3. 2.0.x subscriptions_content/subscriptions_content.module \_subscriptions_content_access()

Implementation of hook_access(), subhook of hook_subscriptions().

File

./subscriptions_content.module, line 131
Subscriptions to content events

Code

function _subscriptions_content_access($load_function, $load_args, $node) {

  ///global $user;  /// keep this for remote debugging
  if (($load_function == 'subscriptions_content_node_load' || $load_function == 'subscriptions_content_comment_load' && $node->_subscriptions_comments) && ($node->status || user_access('administer nodes')) && node_access('view', $node)) {
    if (!empty($node->type) && subscriptions_content_type_is_blocked($node->type) && !user_access('subscribe to all content types')) {
      return FALSE;
    }

    // We vote 'yes'. Other modules might vote 'no' and then that wins.

    ///watchdog('subs debug', "_sca returns TRUE for node $node->nid, user $user->uid.");  ///
    return TRUE;
  }

  ///watchdog('subs debug', "_sca: node_access('view', $node->nid) returns ". node_access('view', $node) ." for user $user->uid.");  ///
}