<?php
namespace Claromentis\People\UseCase;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"] = (@$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"] ?: array()) + array("_01223eefc7979fc91" . "fb28242e36ff55b" => base64_decode("WW91IGRvIG5vdCBoYXZlIHBlcm1pc3Npb24gdG8gdmlldyB0aGlzIG" . "V4dHJhbmV0"));
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["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_01223eefc7979fc91fb28242e36ff5" . "5b"]);
        }
        
        
        
        
        $_9a2ef4ae6a5745ffe5fac33c88a222fa = $this->repo->find((int) $extranet_id);
        return $_9a2ef4ae6a5745ffe5fac33c88a222fa;
    }
}