<?php
namespace Claromentis\People\UseCase;

$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"] ?: array()) + array("_01223eef" . "c7979fc91" . "fb28242e3" . "6ff55b" => base64_decode("WW91IGRvIG5vdCBoYXZlIHBlcm1pc3Npb24gdG8g" . "dmlldyB0aGlzIGV4dHJhbmV0"));
use Claromentis\Core\Security\Exception\AccessDeniedException;
use Claromentis\Core\Security\SecurityContext;
use Claromentis\People\Entity\Extranet;
use Claromentis\People\Exception\NotFoundException;
use Claromentis\People\PeopleAcl;
use Claromentis\People\Repository\ExtranetRepository;
use Claromentis\People\Exception\ValidationException;
use Claromentis\People\Validator\ExtranetValidator;
class GetExtranet
{
    
    
    
    
    protected $acl;
    
    
    
    
    protected $repo;
    
    
    
    
    protected $validator;
    public function __construct(PeopleAcl $acl, ExtranetRepository $repo, ExtranetValidator $_24c8d051c033d19c2c97cdc3d7098b1b)
    {
        $this->acl = $acl;
        $this->repo = $repo;
        $this->validator = $_24c8d051c033d19c2c97cdc3d7098b1b;
    }
    
    
    
    
    
    
    
    
    
    
    public function GetExtranet(SecurityContext $context, $extranet_id)
    {
        $this->validator->ValidateId($extranet_id);
        if (!$this->acl->CanViewExtranet($context, $extranet_id) && !$this->acl->CanViewExtranetAsAdmin($context, $extranet_id)) {
            throw new AccessDeniedException($GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_01223eefc7" . "979fc91fb28" . "242e36ff55b"]);
        }
        
        
        
        
        $_9a2ef4ae6a5745ffe5fac33c88a222fa = $this->repo->find((int) $extranet_id);
        return $_9a2ef4ae6a5745ffe5fac33c88a222fa;
    }
}