function registration_register_page_access in Entity Registration 8.2
Same name and namespace in other branches
- 8 registration.module \registration_register_page_access()
- 7.2 registration.module \registration_register_page_access()
- 7 registration.module \registration_register_page_access()
Access callback: for registration_register_page().
Check if user has access to register for a host entity.
Parameters
string $entity_type: The host entity type.
object $entity: The host entity.
Return value
bool Whether a user can create a new registration for a host entity.
See also
1 call to registration_register_page_access()
- registration_field_formatter_view in includes/
registration.field.inc - Implements hook_field_formatter_view().
1 string reference to 'registration_register_page_access'
- registration_menu in ./
registration.module - @FIXME This implementation of hook_menu() cannot be automatically converted because it contains logic (i.e., branching statements, function calls, object instantiation, etc.) You will need to convert it manually. Sorry!
File
- ./
registration.module, line 497
Code
function registration_register_page_access($entity_type, $entity) {
list($entity_id) = entity_extract_ids($entity_type, $entity);
if ($type = registration_get_entity_registration_type($entity_type, $entity)) {
$registration = entity_get_controller('registration')
->create(array(
'entity_type' => $entity_type,
'entity_id' => $entity_id,
'type' => $type,
));
if (entity_access('create', 'registration', $registration)) {
$settings = registration_entity_settings($entity_type, $entity_id);
if ($settings['status']) {
return TRUE;
}
}
}
return FALSE;
}