mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
fix constructor into acl aware repository
This commit is contained in:
parent
6911ace412
commit
35154f5ae1
@ -6,15 +6,23 @@ use Chill\MainBundle\Entity\Center;
|
|||||||
use Chill\MainBundle\Entity\Scope;
|
use Chill\MainBundle\Entity\Scope;
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||||
|
use Chill\MainBundle\Security\ParentRoleHelper;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
class UserACLAwareRepository implements UserACLAwareRepositoryInterface
|
class UserACLAwareRepository implements UserACLAwareRepositoryInterface
|
||||||
{
|
{
|
||||||
|
private ParentRoleHelper $parentRoleHelper;
|
||||||
|
private EntityManagerInterface $em;
|
||||||
|
|
||||||
private AuthorizationHelper $authorizationHelper;
|
public function __construct(ParentRoleHelper $parentRoleHelper, EntityManagerInterface $em)
|
||||||
|
{
|
||||||
|
$this->parentRoleHelper = $parentRoleHelper;
|
||||||
|
$this->em = $em;
|
||||||
|
}
|
||||||
|
|
||||||
public function findUsersByReachedACL(string $role, $center, $scope = null, bool $onlyEnabled = true): array
|
public function findUsersByReachedACL(string $role, $center, $scope = null, bool $onlyEnabled = true): array
|
||||||
{
|
{
|
||||||
$parents = $this->authorizationHelper->getParentRoles($role);
|
$parents = $this->parentRoleHelper->getParentRoles($role);
|
||||||
$parents[] = $role;
|
$parents[] = $role;
|
||||||
|
|
||||||
$qb = $this->em->createQueryBuilder();
|
$qb = $this->em->createQueryBuilder();
|
||||||
|
@ -321,7 +321,8 @@ class AuthorizationHelper implements AuthorizationHelperInterface
|
|||||||
*/
|
*/
|
||||||
public function findUsersReaching(string $role, $center, $scope = null, bool $onlyEnabled = true): array
|
public function findUsersReaching(string $role, $center, $scope = null, bool $onlyEnabled = true): array
|
||||||
{
|
{
|
||||||
return $this->userACLAwareRepository->findUsersByReachedACL($role, $center, $scope, $onlyEnabled);
|
return $this->userACLAwareRepository
|
||||||
|
->findUsersByReachedACL($role, $center, $scope, $onlyEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user