Skip to content

Commit

Permalink
add access control
Browse files Browse the repository at this point in the history
  • Loading branch information
KaydenLiss committed Jan 11, 2024
1 parent 6e8226b commit c3079f8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Controller/TeamController.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,11 @@ public function setPresetIgnored(
UrlGeneratorInterface $urlGenerator,
TeamRepository $teamRepository,
EntityManagerInterface $em,
InheritanceService $inheritanceService
InheritanceService $inheritanceService,
SecurityService $securityService
): RedirectResponse
{
$user = $this->getUser();
$team = $request->get('team');
$preset = $request->get('preset');
$type = $request->get('type');
Expand All @@ -485,6 +487,10 @@ public function setPresetIgnored(
$preset = $em->getRepository($type)->find($preset);
}

if ($securityService->adminCheck($user, $team) === false) {
return $this->redirectToRoute('dashboard');
}

if ($team && $preset) {
$inheritanceService->setIgnored($preset, $team, $ignored);
$em->persist($preset);
Expand Down

0 comments on commit c3079f8

Please sign in to comment.