<?php
namespace Claromentis\People\UseCase;

$GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"] ?: array()) + array("_01223eefc7979fc9" . "1fb28242e36ff55b" => base64_decode("WW91IGRvIG5vdCBoY" . "XZlIHBlcm1pc3Npb2" . "4gdG8gdmlldyB0aGl" . "zIGV4dHJhbmV0"));
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["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_01223eefc7979fc91f" . "b28242e36ff55b"]);
        }
        
        
        
        
        $_9a2ef4ae6a5745ffe5fac33c88a222fa = $this->repo->find((int) $extranet_id);
        return $_9a2ef4ae6a5745ffe5fac33c88a222fa;
    }
}