<?php
namespace Claromentis\People\UseCase;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"] ?: array()) + array();
use Claromentis\People\Filter\GroupFilter;
use Claromentis\People\PeopleAcl;
use Claromentis\People\Repository\GroupRepository;
class GetGroups
{
    
    
    private $acl;
    
    
    private $repo;
    public function __construct(PeopleAcl $acl, GroupRepository $repo)
    {
        $this->acl = $acl;
        $this->repo = $repo;
    }
    
    
    
    
    
    
    
    public function GetGroups(GroupFilter $_03e9164d0a343b742df4793268b80767) : array
    {
        
        
        $context = $_03e9164d0a343b742df4793268b80767->GetContext();
        if (!$this->acl->IsPeopleAdmin($context) && !$this->acl->IsPowerUser($context)) {
            $_03e9164d0a343b742df4793268b80767->SetFilterByExtranet(true);
        }
        
        
        return [$this->repo->search($_03e9164d0a343b742df4793268b80767), $this->repo->countSearchTotal($_03e9164d0a343b742df4793268b80767)];
    }
}