mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
csfixes
This commit is contained in:
parent
4c704734cd
commit
bb86d04e52
@ -24,12 +24,12 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
protected AuthorizationHelper $authorizationHelper;
|
||||
|
||||
protected Security $security;
|
||||
|
||||
protected TokenStorageInterface $tokenStorage;
|
||||
|
||||
protected TranslatorInterface $translator;
|
||||
|
||||
protected Security $security;
|
||||
|
||||
public function __construct(
|
||||
TokenStorageInterface $tokenStorage,
|
||||
AuthorizationHelper $authorizationHelper,
|
||||
@ -47,7 +47,6 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||
$period = $parameters['accompanyingCourse'];
|
||||
|
||||
if (AccompanyingPeriod::STEP_DRAFT !== $period->getStep()) {
|
||||
|
||||
if ($this->security->isGranted(AccompanyingPeriodVoter::SEE, $period)) {
|
||||
$menu->addChild($this->translator->trans('Calendar'), [
|
||||
'route' => 'chill_calendar_calendar_list',
|
||||
|
@ -25,7 +25,6 @@ class LocationMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderI
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
|
||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
||||
return;
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
*/
|
||||
class SectionMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
|
||||
protected AuthorizationCheckerInterface $authorizationChecker;
|
||||
|
||||
protected TranslatorInterface $translator;
|
||||
@ -42,7 +41,6 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
if (!$this->authorizationChecker->isGranted('ROLE_USER')) {
|
||||
|
||||
$menu->addChild($this->translator->trans('Homepage'), [
|
||||
'route' => 'chill_main_homepage',
|
||||
])
|
||||
@ -61,7 +59,6 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($this->authorizationChecker->isGranted(ChillExportVoter::EXPORT)) {
|
||||
$menu->addChild($this->translator->trans('Export Menu'), [
|
||||
'route' => 'chill_main_export_index',
|
||||
|
@ -21,6 +21,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
private AuthorizationCheckerInterface $authorizationChecker;
|
||||
|
||||
private NotificationByUserCounter $notificationByUserCounter;
|
||||
|
||||
private Security $security;
|
||||
@ -29,8 +31,6 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
|
||||
private WorkflowByUserCounter $workflowByUserCounter;
|
||||
|
||||
private AuthorizationCheckerInterface $authorizationChecker;
|
||||
|
||||
public function __construct(
|
||||
NotificationByUserCounter $notificationByUserCounter,
|
||||
WorkflowByUserCounter $workflowByUserCounter,
|
||||
|
@ -57,7 +57,6 @@ class HouseholdMemberController extends ApiController
|
||||
*/
|
||||
public function editMembership(Request $request, HouseholdMember $member): Response
|
||||
{
|
||||
|
||||
$this->denyAccessUnlessGranted(HouseholdVoter::EDIT, $member);
|
||||
|
||||
$form = $this->createForm(HouseholdMemberType::class, $member, [
|
||||
|
@ -94,7 +94,6 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||
$workflow = $this->registry->get($period, 'accompanying_period_lifecycle');
|
||||
|
||||
if ($this->security->isGranted(AccompanyingPeriodVoter::EDIT, $period)) {
|
||||
|
||||
if (null !== $period->getClosingDate()) {
|
||||
$menu->addChild($this->translator->trans('Re-open accompanying course'), [
|
||||
'route' => 'chill_person_accompanying_course_reopen',
|
||||
|
@ -77,7 +77,6 @@ class HouseholdMenuBuilder implements LocalMenuBuilderInterface
|
||||
], ])
|
||||
->setExtras(['order' => 30]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
|
@ -51,7 +51,6 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
if ($this->security->isGranted(PersonVoter::SEE, $parameters['person'])) {
|
||||
|
||||
$menu->addChild($this->translator->trans('Person details'), [
|
||||
'route' => 'chill_person_view',
|
||||
'routeParameters' => [
|
||||
@ -106,6 +105,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
|
||||
'order' => 100,
|
||||
]);
|
||||
}
|
||||
|
||||
if ($this->security->isGranted(PersonVoter::SEE, $parameters['person'])) {
|
||||
$menu->addChild($this->translator->trans('person_resources_menu'), [
|
||||
'route' => 'chill_person_resource_list',
|
||||
|
@ -32,6 +32,22 @@ class MenuBuilder implements LocalMenuBuilderInterface
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
}
|
||||
|
||||
public function buildAccompanyingCourseMenu($menu, $parameters)
|
||||
{
|
||||
$course = $parameters['accompanyingCourse'];
|
||||
|
||||
if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)) {
|
||||
$menu->addChild(
|
||||
$this->translator->trans('Tasks'),
|
||||
[
|
||||
'route' => 'chill_task_singletask_by-course_list',
|
||||
'routeParameters' => ['id' => $course->getId()],
|
||||
]
|
||||
)
|
||||
->setExtra('order', 400);
|
||||
}
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
switch ($menuId) {
|
||||
@ -55,22 +71,6 @@ class MenuBuilder implements LocalMenuBuilderInterface
|
||||
}
|
||||
}
|
||||
|
||||
public function buildAccompanyingCourseMenu($menu, $parameters)
|
||||
{
|
||||
$course = $parameters['accompanyingCourse'];
|
||||
|
||||
if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)) {
|
||||
$menu->addChild(
|
||||
$this->translator->trans('Tasks'),
|
||||
[
|
||||
'route' => 'chill_task_singletask_by-course_list',
|
||||
'routeParameters' => ['id' => $course->getId()],
|
||||
]
|
||||
)
|
||||
->setExtra('order', 400);
|
||||
}
|
||||
}
|
||||
|
||||
public function buildPersonMenu($menu, $parameters)
|
||||
{
|
||||
//var $person \Chill\PersonBundle\Entity\Person */
|
||||
|
@ -21,7 +21,6 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
|
||||
public AuthorizationCheckerInterface $authorizationChecker;
|
||||
|
||||
public CountNotificationTask $counter;
|
||||
|
Loading…
x
Reference in New Issue
Block a user