<?php
namespace Claromentis\People\UseCase;

$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"] = (@$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"] ?: array()) + array("_01223eefc7979fc91fb28" . "242e36ff55b" => base64_decode("WW91IGRvIG5vdCBoYXZl" . "IHBlcm1pc3Npb24gdG8g" . "dmlldyB0aGlzIGV4dHJh" . "bmV0"));
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["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_01223eefc7979fc91fb28" . "242e36ff55b"]);
        }
        
        
        
        
        $_9a2ef4ae6a5745ffe5fac33c88a222fa = $this->repo->find((int) $extranet_id);
        return $_9a2ef4ae6a5745ffe5fac33c88a222fa;
    }
}