mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-14 06:14:23 +00:00
make aggregor take roles into account
This commit is contained in:
parent
0ab2e85aef
commit
2f9b4a8c81
@ -24,6 +24,8 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
|
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||||
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -82,4 +84,10 @@ class GenderAggregator implements AggregatorInterface
|
|||||||
'_header' => $this->translator->trans('Gender')
|
'_header' => $this->translator->trans('Gender')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function requiredRole()
|
||||||
|
{
|
||||||
|
return new Role(PersonVoter::STATS);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,8 @@ use Doctrine\ORM\QueryBuilder;
|
|||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
|
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -123,6 +125,11 @@ class NationalityAggregator implements AggregatorInterface
|
|||||||
return array('nationality_aggregator');
|
return array('nationality_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function requiredRole()
|
||||||
|
{
|
||||||
|
return new Role(PersonVoter::STATS);
|
||||||
|
}
|
||||||
|
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ($data['group_by_level'] === 'country') {
|
if ($data['group_by_level'] === 'country') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user