You are here

function _authcache_diff_roles in Authenticated User Page Caching (Authcache) 7

Returns an array containing all the roles from account_roles that are not present in allowed_roles.

2 calls to _authcache_diff_roles()
_authcache_is_account_cacheable in ./authcache.helpers.inc
Should user account receive cached pages?
_authcache_is_cacheable in ./authcache.helpers.inc
Should the current page be cached?

File

./authcache.helpers.inc, line 12
Helper functions for the Authcache module (no Drupal hooks here).

Code

function _authcache_diff_roles($account_roles, $allowed_roles) {

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