public function getUserContext(Context $securityContext)
    {
        $account = $securityContext->getAccount();
        if ($account) {
            $party = $this->partyRepository->findOneHavingAccount($account);
            $userContext = [];
            if ($party instanceof Person && $party->getPrimaryElectronicAddress() !== null) {
                $userContext['email'] = (string)$party->getPrimaryElectronicAddress();
            } elseif ($party !== null && ObjectAccess::isPropertyGettable($party, 'emailAddress')) {
                $userContext['email'] = (string)ObjectAccess::getProperty($party, 'emailAddress');
            }

            return $userContext;
        }

        return [];
    }