You are here

function notifications_subscription_access in Notifications 6.4

Same name and namespace in other branches
  1. 6 notifications.module \notifications_subscription_access()
  2. 6.2 notifications.module \notifications_subscription_access()
  3. 6.3 notifications.module \notifications_subscription_access()

Menu access callback

1 string reference to 'notifications_subscription_access'
notifications_menu in ./notifications.module
Implementation of hook_menu().

File

./notifications.module, line 350
Notifications module

Code

function notifications_subscription_access($op, $subscription, $account = NULL) {
  global $user;
  $account = $account ? $account : $user;
  if (user_access('administer notifications') || user_access('manage all subscriptions')) {
    return TRUE;
  }
  switch ($op) {
    case 'edit':
    case 'unsubscribe':
      return $subscription->uid && $subscription->uid == $account->uid && user_access('maintain own subscriptions');
  }
  return FALSE;
}