public function Notifications_Subscription::user_access in Notifications 7
Check user access to this subscription
Overrides Notifications_Entity::user_access
File
- ./
notifications.subscription.inc, line 897 - Drupal Notifications Framework - Default class file
Class
- Notifications_Subscription
- Common base for subscription type and subscription instance
Code
public function user_access($account, $op = 'view') {
// If this has a user, only same user or administrators have access
if (!empty($this->uid) && $account->uid != $this->uid && !user_access('administer notifications', $account) && !user_access('administer subscriptions', $account)) {
return FALSE;
}
elseif ($op == 'view') {
return TRUE;
}
elseif ($op == 'subscribe') {
// To create a new subscription user needs to have access to all the objects
return $this
->type_access($account) && $this
->object_access($account);
}
}