Changed name of PersonMenuBuilder

More general name since it also contains the AccompanyingPeriod task menu entry now.
This commit is contained in:
Julie Lenaerts 2021-09-17 14:49:43 +02:00
parent 6e3ce06fcf
commit 34dd35f2e2
2 changed files with 25 additions and 27 deletions

View File

@ -28,7 +28,7 @@ use Symfony\Component\Translation\TranslatorInterface;
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class PersonMenuBuilder implements LocalMenuBuilderInterface
class MenuBuilder implements LocalMenuBuilderInterface
{
/**
*
@ -86,12 +86,10 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
public function buildAccompanyingCourseMenu($menu, $parameters){
//var $person \Chill\PersonBundle\Entity\Person */
$course = $parameters['accompanyingCourse'];
//TODO: implement voter again?
// if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)) {
if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)) {
$menu->addChild(
$this->translator->trans('Tasks'), [
'route' => 'chill_task_singletask_courselist',
@ -99,7 +97,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
[ 'course_id' => $course->getId() ]
])
->setExtra('order', 400);
// }
}
}
public static function getMenuIds(): array

View File

@ -1,23 +1,23 @@
services:
Chill\TaskBundle\Menu\UserMenuBuilder:
arguments:
$tokenStorage: '@Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface'
$counter: '@Chill\TaskBundle\Templating\UI\CountNotificationTask'
$translator: '@Symfony\Component\Translation\TranslatorInterface'
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
tags:
- { name: 'chill.menu_builder' }
Chill\TaskBundle\Menu\PersonMenuBuilder:
arguments:
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
$translator: '@Symfony\Component\Translation\TranslatorInterface'
tags:
- { name: 'chill.menu_builder' }
Chill\TaskBundle\Menu\SectionMenuBuilder:
arguments:
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
$translator: '@Symfony\Component\Translation\TranslatorInterface'
tags:
- { name: 'chill.menu_builder' }
Chill\TaskBundle\Menu\UserMenuBuilder:
arguments:
$tokenStorage: '@Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface'
$counter: '@Chill\TaskBundle\Templating\UI\CountNotificationTask'
$translator: '@Symfony\Component\Translation\TranslatorInterface'
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
tags:
- { name: "chill.menu_builder" }
Chill\TaskBundle\Menu\MenuBuilder:
arguments:
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
$translator: '@Symfony\Component\Translation\TranslatorInterface'
tags:
- { name: "chill.menu_builder" }
Chill\TaskBundle\Menu\SectionMenuBuilder:
arguments:
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
$translator: '@Symfony\Component\Translation\TranslatorInterface'
tags:
- { name: "chill.menu_builder" }