You are here

public function AuthcacheFieldFragment::check in Authenticated User Page Caching (Authcache) 7.2

Check whether the user has access to the given fragment.

Parameters

object $account: The user account to check.

string $key: The key for the fragment to be checked.

var $subject: The result of the loader function for the given key. If no AuthcacheP13nFragmentLoader is associated with this fragment, subject is equal to key.

array $context: Additional run-time per-request context (key-value pairs).

Return value

bool Return TRUE when the user has access, FALSE otherwise.

Overrides AuthcacheP13nFragmentAccessInterface::check

File

modules/authcache_field/includes/AuthcacheFieldFragment.inc, line 70
Defines fragment for fields.

Class

AuthcacheFieldFragment
Fragment handler for fields.

Code

public function check($account, $field_specifier, $args, $context) {
  list($entity) = $args;
  return entity_access('view', $this->entityType, $entity, $account) && field_access('view', field_info_field($this->fieldName), $this->entityType, $entity, $account);
}