mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 11:03:50 +00:00
fix some authorization check in menu
This commit is contained in:
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\TaskBundle\Menu;
|
||||
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\TaskBundle\Security\Authorization\TaskVoter;
|
||||
use Knp\Menu\MenuItem;
|
||||
use LogicException;
|
||||
@@ -40,9 +41,11 @@ class MenuBuilder implements LocalMenuBuilderInterface
|
||||
|
||||
public function buildAccompanyingCourseMenu($menu, $parameters)
|
||||
{
|
||||
/** @var AccompanyingPeriod $course */
|
||||
$course = $parameters['accompanyingCourse'];
|
||||
|
||||
if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)) {
|
||||
if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)
|
||||
&& AccompanyingPeriod::STEP_DRAFT !== $course->getStep()) {
|
||||
$menu->addChild(
|
||||
$this->translator->trans('Tasks'),
|
||||
[
|
||||
|
Reference in New Issue
Block a user