function profile_category_access
profile_category_access($account, $category)
Menu item access callback - check if a user has access to a profile category.
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; } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!profile!profile.module/function/profile_category_access/7.x