You are here

function nodequeue_api_subqueue_access in Nodequeue 5.2

Same name and namespace in other branches
  1. 6.2 nodequeue.module \nodequeue_api_subqueue_access()
  2. 7.3 nodequeue.module \nodequeue_api_subqueue_access()
  3. 7.2 nodequeue.module \nodequeue_api_subqueue_access()

Allows the owning module of a subqueue to restrict access to viewing and manipulating the queue.

5 calls to nodequeue_api_subqueue_access()
nodequeue_admin_view in ./nodequeue.module
Page callback to view a queue.
nodequeue_menu in ./nodequeue.module
Implementation of hook_menu
nodequeue_view_queues in ./nodequeue.module
Display a list of queues and their status for the administrator.
nodequeue_view_subqueues in ./nodequeue.module
Display a list of subqueues for a queue and their sizes
_nodequeue_ajax_add in ./nodequeue.module

File

./nodequeue.module, line 2444

Code

function nodequeue_api_subqueue_access($subqueue, $account = NULL, $queue = NULL) {
  if (!$account) {
    global $user;
    $account = $user;
  }
  if (!$queue) {
    $queue = nodequeue_load($subqueue->qid);
  }
  $function = $queue->owner . '_subqueue_access';
  if (function_exists($function)) {
    $access = $function($subqueue, $account, $queue);
  }
  if (!isset($access)) {
    $access = TRUE;
  }
  return $access;
}