You are here

function _subscriptions_content_access in Subscriptions 7

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

Implements _hook_access(), subhook of hook_subscriptions().

Parameters

string $load_function:

string $load_args:

object $node:

Return value

bool|null

File

./subscriptions_content.module, line 175
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_load_node' || $load_function == 'subscriptions_content_load_comment' && !empty($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.");  ///
  return NULL;
}