function _onepageprofile_check_access in One page profile 6
Same name and namespace in other branches
- 5.2 onepageprofile.module \_onepageprofile_check_access()
- 7 onepageprofile.module \_onepageprofile_check_access()
Check if access is allowed to this category by the user
We need to do this, instead of profile_category_access(), because we want integration with the profile_roles module.
1 call to _onepageprofile_check_access()
- onepageprofile_user in ./
onepageprofile.module - Implementation of hook_user().
File
- ./
onepageprofile.module, line 294
Code
function _onepageprofile_check_access($account, $category) {
$map = array(
'user',
$account,
'edit',
$category['name'],
);
// Check access by pretending our category is a menu item
$category['access_callback'] = $category['access callback'];
$category['access_arguments'] = serialize($category['access arguments']);
_menu_check_access($category, $map);
// Integrate with the profile_role module
$menu['access'] = TRUE;
if (function_exists('profile_role_access_category')) {
$menu['access'] = profile_role_access_category($account, $category['name']);
}
return $menu['access'] && $category['access'];
}