function bat_event_add_access in Booking and Availability Management Tools for Drupal 7
Access callback: Checks whether the user has permission to add an event.
Return value
bool TRUE if the user has add permission, otherwise FALSE.
1 string reference to 'bat_event_add_access'
- BatEventUIController::hook_menu in modules/
bat_event/ bat_event.admin.inc - Overrides hook_menu() defaults.
File
- modules/
bat_event/ bat_event.module, line 755 - Manage Events - Events store the EventValue of a Unit over a period of time.
Code
function bat_event_add_access() {
if (user_access('administer bat_event_type entities')) {
// There are no event types defined that the user has permission to create
// but the user does have the permission to administer the content types, so
// grant them access to the page anyway.
return TRUE;
}
$types = bat_event_get_types();
foreach ($types as $type) {
if (bat_event_access('create', bat_event_create(array(
'type' => $type->type,
'uid' => 0,
)))) {
return TRUE;
}
}
return FALSE;
}