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

$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"] = (@$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"] ?: array()) + array("_3a986140" . "ecf6bf9d5" . "526b45230" . "cf9b83" => base64_decode("VW5hdX" . "Rob3Jp" . "emVk"), "_79bd87060" . "993ff622ef" . "212c1e8b6a" . "79a" => base64_decode("Rm9" . "yYm" . "lkZ" . "GVu"));
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["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_79bd8706099" . "3ff622ef212c" . "1e8b6a79a"], $exception);
        } else {
            return new RestExAuth(($this->lmsg)(self::E_AUTH_NEEDED), $GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_3a986140ecf6bf9d55" . "26b45230cf9b83"], $exception);
        }
    }
}