function profile_category_access
Menu item access callback - check if a user has access to a profile category.
1 string reference to 'profile_category_access'
- profile_user_categories in modules/
profile/ profile.module - Implements hook_user_categories().
File
-
modules/
profile/ profile.module, line 519
Code
function profile_category_access($account, $category) {
if (user_access('administer users') && $account->uid > 0) {
return TRUE;
}
else {
$category_visible = (bool) db_query_range('SELECT 1 FROM {profile_field} WHERE category = :category AND visibility <> :visibility', 0, 1, array(
':category' => $category,
':visibility' => PROFILE_HIDDEN,
))->fetchField();
return user_edit_access($account) && $category_visible;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.