<?php
namespace Claromentis\People\Controller\Rest;

$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"] = (@$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"] ?: array()) + array("_79bd870609" . "93ff622ef21" . "2c1e8b6a79a" => base64_decode("Rm9yYmlkZ" . "GVu"), "_3a986140ecf6bf9d" . "5526b45230cf9b83" => base64_decode("VW5h" . "dXRo" . "b3Jp" . "emVk"));
use Claromentis\Core\Http\JsonPrettyResponse;
use Claromentis\Core\Localization\Lmsg;
use Claromentis\Core\Security\SecurityContext;
use Claromentis\Core\Services;
use Claromentis\People\Exception\ValidationException;
use Claromentis\People\RestFormatter;
use Exception;
use Psr\Http\Message\ServerRequestInterface;
use RestExAuth;
use RestExForbidden;






abstract class AbstractController
{
    const E_AUTH_NEEDED = 'common.error.auth_needed';
    
    
    
    
    protected $lmsg;
    
    
    
    
    
    
    protected function GetAuthException(SecurityContext $context, Exception $exception)
    {
        if ($context->GetUserId()) {
            return new RestExForbidden($exception->getMessage(), $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_79bd87060993ff622ef212c1e8b6a7" . "9a"], $exception);
        } else {
            return new RestExAuth(($this->lmsg)(self::E_AUTH_NEEDED), $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_3a986140e" . "cf6bf9d552" . "6b45230cf9" . "b83"], $exception);
        }
    }
}