public function isAccessGranted(array $page)
{
if (!$this->isAccessProtected($page)) {
return true;
}
$groups = explode(',', $page['fe_group']);
$showPageAtAnyLogin = in_array(-2, $groups);
$hidePageAtAnyLogin = in_array(-1, $groups);
$userIsLoggedIn = is_array($GLOBALS['TSFE']->fe_user->user);
$userGroups = $GLOBALS['TSFE']->fe_user->groupData['uid'];
$userIsInGrantedGroups = 0 < count(array_intersect($userGroups, $groups));
if (false === $userIsLoggedIn && true === $hidePageAtAnyLogin || true === $userIsLoggedIn && true === $showPageAtAnyLogin || true === $userIsLoggedIn && true === $userIsInGrantedGroups) {
return true;
}
return false;
}