function notifications_user_allowed in Notifications 6.2
Same name and namespace in other branches
- 5 notifications.module \notifications_user_allowed()
- 6.4 notifications.module \notifications_user_allowed()
- 6 notifications.module \notifications_user_allowed()
- 6.3 notifications.module \notifications_user_allowed()
Check access to objects
This will check permissions for subscriptions and events before subscribing and before getting updates.
Parameters
$type: Type of object to check for access. Possible values:
- 'event', will check access to event objects
- 'subscription', will check access to subscribed objects
4 calls to notifications_user_allowed()
- NotificationsContentTests::testNotificationsContent in tests/
notifications_content.test - Play with creating, retrieving, deleting a pair subscriptions
- notifications_page_subscribe in ./
notifications.pages.inc - Menu callback add subscription
- notifications_process_rows in ./
notifications.cron.inc - Process rows given query conditions
- notifications_ui_subscribe_options in notifications_ui/
notifications_ui.module - Get list of possible and existing subscriptions for user/object
File
- ./
notifications.module, line 1382 - Notifications module
Code
function notifications_user_allowed($type, $account, $object = NULL) {
// Invoke notifications hook and check for a FALSE return value
$permissions = notifications_module_information('access', $type, $account, $object);
if ($permissions) {
return !in_array(FALSE, $permissions);
}
else {
// If no module has anthing to say about access I guess it will be true
return TRUE;
}
}