You are here

function notifications_page_check_access in Notifications 7

Same name and namespace in other branches
  1. 6.4 notifications.pages.inc \notifications_page_check_access()

Check access to current page, included signature

Parameters

$owner: User id, owner of the object in the page (subscription, destination, account)

File

./notifications.pages.inc, line 152
User pages for Notifications

Code

function notifications_page_check_access($owner) {
  global $user;
  if (user_access('administer notifications')) {
    return TRUE;

    // Administrator can access all
  }
  elseif ($owner) {

    // Current user is the owner or the URL is signed
    return $user->uid == $owner || notifications_page_check_signature();
  }
  elseif (module_exists('notifications_anonymous')) {

    // Owner is anonymous but we just allow it if the module is enabled the URL is signed
    return notifications_page_check_signature();
  }
}