<?php
namespace Claromentis\People\UseCase;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"] ?: array()) + array("_01223eefc7979f" . "c91fb28242e36ff" . "55b" => base64_decode("WW91IGRvIG5vdCBoYXZlIHBlcm1pc3Npb24gdG8gdmlld" . "yB0aGlzIGV4dHJhbmV0"));
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["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_01223eefc7979f" . "c91fb28242e36ff" . "55b"]);
        }
        
        
        
        
        $_9a2ef4ae6a5745ffe5fac33c88a222fa = $this->repo->find((int) $extranet_id);
        return $_9a2ef4ae6a5745ffe5fac33c88a222fa;
    }
}