You are here

function facetapi_access_callback in Facet API 7

Same name and namespace in other branches
  1. 6.3 facetapi.module \facetapi_access_callback()
  2. 7.2 facetapi.module \facetapi_access_callback()

Returns the access callback.

Custom access callback. Checks if the user has either the "administer search" OR "administer facets" permissions.

Parameters

stdObject|NULL $account: (optional) The account to check, if not given use currently logged in user.

Return value

bool TRUE if the user has access to the resource, FALSE otherwise.

1 call to facetapi_access_callback()
FacetapiApiFunctions::testAccessCallback in tests/facetapi.test
Tests the facetapi_access_callback() access callback.
2 string references to 'facetapi_access_callback'
current_search_menu_alter in contrib/current_search/current_search.module
Implements hook_menu_alter().
facetapi_menu in ./facetapi.module
Implements hook_menu().

File

./facetapi.module, line 321
An abstracted facet API that can be used by various search backends.

Code

function facetapi_access_callback($account = NULL) {
  global $user;
  if (!isset($account)) {
    $account = $user;
  }
  return user_access('administer search', $account) || user_access('administer facets', $account);
}