You are here

function authcache_authcache_key_properties in Authenticated User Page Caching (Authcache) 7.2

Implements hook_authcache_key_properties().

Related topics

File

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

Code

function authcache_authcache_key_properties() {
  global $user, $base_root;

  // Remove "authenticated user"-role from the account roles except when it is
  // the only role on the account.
  $account_roles = $user->roles;
  if (array_keys($account_roles) !== array(
    DRUPAL_AUTHENTICATED_RID,
  )) {
    unset($account_roles[DRUPAL_AUTHENTICATED_RID]);
  }
  $roles = array_keys($account_roles);
  sort($roles);
  return array(
    'base_root' => $base_root,
    'roles' => $roles,
  );
}