mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
add ACL for export
This commit is contained in:
parent
c74754af09
commit
9cb37a6115
@ -24,6 +24,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Doctrine\ORM\Query\Expr;
|
use Doctrine\ORM\Query\Expr;
|
||||||
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -78,4 +79,9 @@ class GenderFilter implements FilterInterface
|
|||||||
{
|
{
|
||||||
return 'Filter by person gender';
|
return 'Filter by person gender';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function requiredRole()
|
||||||
|
{
|
||||||
|
return new Role(\Chill\PersonBundle\Security\Authorization\PersonVoter::STATS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Doctrine\ORM\Query\Expr;
|
use Doctrine\ORM\Query\Expr;
|
||||||
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -63,4 +64,9 @@ class NationalityFilter implements FilterInterface
|
|||||||
{
|
{
|
||||||
return "Filter by person's nationality";
|
return "Filter by person's nationality";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function requiredRole()
|
||||||
|
{
|
||||||
|
return new Role(\Chill\PersonBundle\Security\Authorization\PersonVoter::STATS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,12 +49,12 @@ class PersonVoter extends AbstractChillVoter implements ProvideRoleInterface
|
|||||||
|
|
||||||
protected function getSupportedAttributes()
|
protected function getSupportedAttributes()
|
||||||
{
|
{
|
||||||
return array(self::CREATE, self::UPDATE, self::SEE);
|
return array(self::CREATE, self::UPDATE, self::SEE, self::STATS);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getSupportedClasses()
|
protected function getSupportedClasses()
|
||||||
{
|
{
|
||||||
return array('Chill\PersonBundle\Entity\Person');
|
return array('Chill\PersonBundle\Entity\Person', 'Chill\MainBundle\Entity\Center');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function isGranted($attribute, $person, $user = null)
|
protected function isGranted($attribute, $person, $user = null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user