mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
set ACL only if page is shown
This commit is contained in:
parent
59807c2d17
commit
d8c3cc4c84
@ -84,10 +84,6 @@ class TaskController extends Controller
|
|||||||
return $t->getName() === $transition;
|
return $t->getName() === $transition;
|
||||||
}
|
}
|
||||||
))[0];
|
))[0];
|
||||||
|
|
||||||
// we simply check that the user can see the task. Other ACL checks
|
|
||||||
// should be performed using `guard` events.
|
|
||||||
$this->denyAccessUnlessGranted(TaskVoter::SHOW, $task);
|
|
||||||
|
|
||||||
$form = $this->createTransitionForm($task);
|
$form = $this->createTransitionForm($task);
|
||||||
|
|
||||||
@ -118,6 +114,10 @@ class TaskController extends Controller
|
|||||||
if ($event->hasResponse()) {
|
if ($event->hasResponse()) {
|
||||||
return $event->getResponse();
|
return $event->getResponse();
|
||||||
} else {
|
} else {
|
||||||
|
// we simply check that the user can see the task. Other ACL checks
|
||||||
|
// should be performed using `guard` events.
|
||||||
|
$this->denyAccessUnlessGranted(TaskVoter::SHOW, $task);
|
||||||
|
|
||||||
return $this->render($defaultTemplate, [
|
return $this->render($defaultTemplate, [
|
||||||
'task' => $task,
|
'task' => $task,
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user