mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Add ACL to edit membership
This commit is contained in:
parent
0ffd6a857c
commit
4c704734cd
@ -19,6 +19,7 @@ use Chill\PersonBundle\Entity\Person;
|
|||||||
use Chill\PersonBundle\Form\HouseholdMemberType;
|
use Chill\PersonBundle\Form\HouseholdMemberType;
|
||||||
use Chill\PersonBundle\Household\MembersEditor;
|
use Chill\PersonBundle\Household\MembersEditor;
|
||||||
use Chill\PersonBundle\Repository\AccompanyingPeriodRepository;
|
use Chill\PersonBundle\Repository\AccompanyingPeriodRepository;
|
||||||
|
use Chill\PersonBundle\Security\Authorization\HouseholdVoter;
|
||||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||||
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
|
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@ -26,7 +27,7 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
use Symfony\Component\Serializer\Exception;
|
use Symfony\Component\Serializer\Exception;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
@ -56,7 +57,8 @@ class HouseholdMemberController extends ApiController
|
|||||||
*/
|
*/
|
||||||
public function editMembership(Request $request, HouseholdMember $member): Response
|
public function editMembership(Request $request, HouseholdMember $member): Response
|
||||||
{
|
{
|
||||||
// TODO ACL
|
|
||||||
|
$this->denyAccessUnlessGranted(HouseholdVoter::EDIT, $member);
|
||||||
|
|
||||||
$form = $this->createForm(HouseholdMemberType::class, $member, [
|
$form = $this->createForm(HouseholdMemberType::class, $member, [
|
||||||
'validation_groups' => ['household_memberships'],
|
'validation_groups' => ['household_memberships'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user