You are here

function authcache_role_restrict_access in Authenticated User Page Caching (Authcache) 7.2

Check whether given account is allowed by configuration.

Related topics

4 calls to authcache_role_restrict_access()
AuthcacheTestAdminWidgets::testRoleRestrictAccess in tests/authcache.widget.test
Cover authcache_role_restrict_access().
authcache_authcache_account_exclude in ./authcache.module
Implements hook_authcache_account_exclude().
authcache_authcache_request_exclude in ./authcache.module
Implements hook_authcache_request_exclude().
_authcache_form_allow_p13n in modules/authcache_form/authcache_form.module
Test whether defered retrieval of form token / build-id is allowed.

File

./authcache.module, line 1311
Authenticated User Page Caching (and anonymous users, too!)

Code

function authcache_role_restrict_access($config, $account = NULL) {
  global $user;
  if (!$account) {
    $account = $user;
  }
  $allowed_roles = authcache_get_role_restrict_roles($config);
  $extra_roles = authcache_diff_roles($account->roles, $allowed_roles);
  return empty($extra_roles);
}