public function checkSiteAccessPermission(BaseInteractiveLoginEvent $event)
    {
        $token = $event->getAuthenticationToken();
        $originalUser = $token->getUser();
        $request = $event->getRequest();
        $siteAccess = $request->attributes->get('siteaccess');
        if (!($originalUser instanceof eZUser && $siteAccess instanceof SiteAccess)) {
            return;
        }

        if (!$this->hasAccess($siteAccess, $originalUser->getUsername())) {
            throw new UnauthorizedSiteAccessException($siteAccess, $originalUser->getUsername());
        }
    }
public function checkSiteAccessPermission(BaseInteractiveLoginEvent $event)
    {
        $token = $event->getAuthenticationToken();
        $originalUser = $token->getUser();
        $request = $event->getRequest();
        $siteAccess = $request->attributes->get('siteaccess');
        if (!($originalUser instanceof eZUser && $siteAccess instanceof SiteAccess)) {
            return;
        }

        if (!$this->hasAccess($siteAccess, $originalUser->getUsername())) {
            throw new UnauthorizedSiteAccessException($siteAccess, $originalUser->getUsername());
        }
    }
public function checkSiteAccessPermission ( BaseInteractiveLoginEvent $ event ) { $ token = $ event -> getAuthenticationToken ( ) ; $ originalUser = $ token -> getUser ( ) ; $ request = $ event -> getRequest ( ) ; $ siteAccess = $ request -> attributes -> get ( 'siteaccess' ) ; if ( ! ( $ originalUser instanceof eZUser && $ siteAccess instanceof SiteAccess ) ) { return ; } if ( ! $ this -> hasAccess ( $ siteAccess , $ originalUser -> getUsername ( ) ) ) { throw new UnauthorizedSiteAccessException ( $ siteAccess , $ originalUser -> getUsername ( ) ) ; } }
Throws an UnauthorizedSiteAccessException if current user doesn't have permission to current SiteAccess.

@param BaseInteractiveLoginEvent $event

@throws \eZ\Publish\Core\MVC\Symfony\Security\Exception\UnauthorizedSiteAccessException
Throws an UnauthorizedSiteAccessException if current user doesn t have permission to current SiteAccess .