You are here

function notifications_anonymous_destination_access in Notifications 6.4

Menu access callback for destinations

1 string reference to 'notifications_anonymous_destination_access'
notifications_anonymous_menu in notifications_anonymous/notifications_anonymous.module
Implementation of hook_menu()

File

notifications_anonymous/notifications_anonymous.module, line 101
Notifications for anonymous users

Code

function notifications_anonymous_destination_access($op, $destination = NULL, $account = NULL) {
  global $user;
  $account = $account ? $account : $user;

  // Access will be granted if anonymous destination or administrator
  if (user_access('administer notifications')) {
    return TRUE;
  }
  elseif (!$destination->uid) {
    switch ($op) {
      case 'manage':
        return user_access('manage own subscriptions', $account);
      case 'edit':
        return user_access('maintain own subscriptions', $account);
      case 'confirm':
      case 'delete':
        return TRUE;
    }
  }
  else {
    return FALSE;
  }
}