public function AuthcacheP13nTestEchoFragmentAccess::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_p13n/ tests/ authcache_p13n.stub.inc, line 473 - Stub classes for testing.
Class
- AuthcacheP13nTestEchoFragmentAccess
- Stub class for fragment access checker
Code
public function check($account, $key, $subject, $context) {
return $key !== 'account' || $subject == $account;
}