function profile_category_access in Drupal 7
Same name and namespace in other branches
- 6 modules/profile/profile.module \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 - Support for configurable user profiles.
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;
}
}