Is Backend-User:
PHP-Code:
$security = System::getContainer()->get('security.helper');
if ($security->isGranted('ROLE_ADMIN')){}
Backend-User ist eingeloggt:
PHP-Code:
$objTokenChecker = \System::getContainer()->get('contao.security.token_checker');
if ($objTokenChecker->hasBackendUser()) {}
Frontend-User ist eingeloggt:
PHP-Code:
$objTokenChecker = \System::getContainer()->get('contao.security.token_checker');
if ($objTokenChecker->hasFrontendUser()) {}
Frontend-User gehört zur Gruppe:
PHP-Code:
$security = System::getContainer()->get('security.helper');
$security->isGranted('contao_member.groups', $idDerGruppe);