You are here

function notifications_access_user in Notifications 6.4

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

Menu access callback for user subscriptions

Parameters

$account: User account to which these subscriptions below

$op:

  • maintain = create / delete
  • manage = use the per account administration page
4 calls to notifications_access_user()
notifications_access_user_add in ./notifications.module
Menu access callback, add a given subscription type
notifications_page_unsubscribe_overview in ./notifications.pages.inc
Display unsubscribe options for this page
notifications_ui_access_page in notifications_ui/notifications_ui.module
Menu access callback: account pages
notifications_user_overview in ./notifications.pages.inc
Menu callback. Overview page for user subscriptions.
1 string reference to 'notifications_access_user'
notifications_menu in ./notifications.module
Implementation of hook_menu().

File

./notifications.module, line 248
Notifications module

Code

function notifications_access_user($account, $op = 'maintain') {
  global $user;
  if (user_access('administer notifications') || user_access('manage all subscriptions')) {
    return TRUE;
  }
  else {
    return $account->uid && $user->uid == $account->uid && ($op == 'maintain' && user_access('maintain own subscriptions') || $op == 'manage' && user_access('manage own subscriptions'));
  }
}