You are here

function scheduler_list_access_callback in Scheduler 7

Same name and namespace in other branches
  1. 6 scheduler.module \scheduler_list_access_callback()

Return the users access to the scheduler list page.

Separate function required because of the two access values to be checked.

Parameters

int $uid: The user ID of the user of which the scheduled nodes will be listed. Omit this when listing the nodes of all users.

1 string reference to 'scheduler_list_access_callback'
scheduler_menu in ./scheduler.module
Implements hook_menu().

File

./scheduler.module, line 149
Scheduler publishes and unpublishes nodes on dates specified by the user.

Code

function scheduler_list_access_callback($uid = NULL) {
  global $user;

  // All Scheduler users can see their own scheduled content via their user
  // page. In addition, if they have 'view scheduled content' permission they
  // will be able to see all scheduled content by all authors.
  return user_access('view scheduled content') || $uid == $user->uid && user_access('schedule publishing of nodes');
}