make aggregor take roles into account

This commit is contained in:
2016-01-26 11:47:04 +01:00
parent 0ab2e85aef
commit 2f9b4a8c81
2 changed files with 15 additions and 0 deletions

View File

@@ -25,6 +25,8 @@ use Doctrine\ORM\QueryBuilder;
use Doctrine\ORM\EntityRepository;
use Chill\MainBundle\Templating\TranslatableStringHelper;
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');
}
public function requiredRole()
{
return new Role(PersonVoter::STATS);
}
public function getLabels($key, array $values, $data)
{
if ($data['group_by_level'] === 'country') {