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;
|
||||
}
|
||||
))[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);
|
||||
|
||||
@ -118,6 +114,10 @@ class TaskController extends Controller
|
||||
if ($event->hasResponse()) {
|
||||
return $event->getResponse();
|
||||
} 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, [
|
||||
'task' => $task,
|
||||
'form' => $form->createView(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user