mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
voter updates
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Form\AccompanyingCourseCommentType;
|
||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodCommentVoter;
|
||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use LogicException;
|
||||
@@ -83,7 +84,7 @@ class AccompanyingCourseCommentController extends AbstractController
|
||||
}
|
||||
|
||||
if (isset($commentEdited)) {
|
||||
$this->denyAccessUnlessGranted(AccompanyingPeriodVoter::EDIT, $commentEdited->getAccompanyingPeriod());
|
||||
$this->denyAccessUnlessGranted(AccompanyingPeriodCommentVoter::EDIT, $commentEdited);
|
||||
} else {
|
||||
throw new LogicException('at this step, commentEdited should be set');
|
||||
}
|
||||
@@ -134,7 +135,7 @@ class AccompanyingCourseCommentController extends AbstractController
|
||||
*/
|
||||
public function deleteAction(AccompanyingPeriod\Comment $comment, Request $request): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted(AccompanyingPeriodVoter::EDIT, $comment->getAccompanyingPeriod());
|
||||
$this->denyAccessUnlessGranted(AccompanyingPeriodCommentVoter::DELETE, $comment);
|
||||
|
||||
$form = $this->createForm(FormType::class, []);
|
||||
$form->add('submit', SubmitType::class, ['label' => 'Confirm']);
|
||||
|
Reference in New Issue
Block a user