protected static evaluateCondition ( null $arguments = null, TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface $renderingContext ) : boolean | ||
$arguments | null | |
$renderingContext | TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface | |
return | boolean |
protected static function evaluateCondition($arguments = null, RenderingContextInterface $renderingContext)
{
$objectManager = $renderingContext->getObjectManager();
/** @var Context $securityContext */
$securityContext = $objectManager->get(Context::class);
$activeTokens = $securityContext->getAuthenticationTokens();
$isAuthenticated = false;
foreach ($activeTokens as $token) {
if ($token->isAuthenticated()) {
$isAuthenticated = true;
}
}
return $isAuthenticated;
}