mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-14 14:24:24 +00:00
implement acl in query
This commit is contained in:
parent
2f9b4a8c81
commit
e79aebabff
@ -62,12 +62,18 @@ class CountPerson implements ExportInterface
|
|||||||
* @param QueryBuilder $qb
|
* @param QueryBuilder $qb
|
||||||
* @return QueryBuilder
|
* @return QueryBuilder
|
||||||
*/
|
*/
|
||||||
public function initiateQuery(QueryBuilder $qb, array $requiredModifiers)
|
public function initiateQuery(QueryBuilder $qb, array $requiredModifiers, $acl)
|
||||||
{
|
{
|
||||||
|
$centers = array_map(function($el) { return $el['center']; }, $acl);
|
||||||
|
|
||||||
$qb->select('COUNT(person.id) AS export_result')
|
$qb->select('COUNT(person.id) AS export_result')
|
||||||
->from('ChillPersonBundle:Person', 'person')
|
->from('ChillPersonBundle:Person', 'person')
|
||||||
|
->join('person.center', 'center')
|
||||||
|
->andWhere('center IN (:authorized_centers)')
|
||||||
|
->setParameter('authorized_centers', $centers);
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user