FluidTYPO3\Vhs\ViewHelpers\Security\AbstractSecurityViewHelper::assertFrontendUserGroupLoggedIn PHP Method

assertFrontendUserGroupLoggedIn() public method

Returns TRUE if a FrontendUserGroup (specific given argument, else not) is logged in
public assertFrontendUserGroupLoggedIn ( mixed $groups = null ) : boolean
$groups mixed One \TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup or ObjectStorage containing same
return boolean
    public function assertFrontendUserGroupLoggedIn($groups = null)
    {
        $currentFrontendUser = $this->getCurrentFrontendUser();
        if (false === $currentFrontendUser instanceof FrontendUser) {
            return false;
        }
        $currentFrontendUserGroups = $currentFrontendUser->getUsergroup();
        if (null === $groups) {
            return (bool) (0 < $currentFrontendUserGroups->count());
        } elseif (true === $groups instanceof FrontendUserGroup) {
            return $currentFrontendUserGroups->contains($groups);
        } elseif (true === $groups instanceof ObjectStorage) {
            $currentFrontendUserGroupsClone = clone $currentFrontendUserGroups;
            $currentFrontendUserGroupsClone->removeAll($groups);
            return $currentFrontendUserGroups->count() !== $currentFrontendUserGroupsClone->count();
        } else {
            return false;
        }
    }