public static function getSubject()
    {
        $logger  = $GLOBALS['logger'];
        $app     = $GLOBALS['app'];
        $subject = $app->getSubject();
        $logger->debug('Subject authentication status = '.$subject->isAuthenticated());
        if ($subject === null) {
            $subject = Subject::createBuilder()->build();
            $app->setSubject($subject);
        }

        return $subject;

    }