improve permission checks for report access (#2658)

This commit is contained in:
Kevin Papst
2021-07-13 06:21:31 +02:00
committed by GitHub
parent a1f90ffaba
commit 7661d43327
3 changed files with 31 additions and 23 deletions

View File

@@ -14,7 +14,6 @@ use App\Entity\Project;
use App\Project\ProjectStatisticService;
use App\Reporting\ProjectDetails\ProjectDetailsForm;
use App\Reporting\ProjectDetails\ProjectDetailsQuery;
use App\Utils\LocaleSettings;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
@@ -23,9 +22,9 @@ final class ProjectDetailsController extends AbstractController
{
/**
* @Route(path="/reporting/project_details", name="report_project_details", methods={"GET"})
* @Security("is_granted('view_reporting') and is_granted('details_project')")
* @Security("is_granted('view_reporting') and (is_granted('details_project') or is_granted('details_teamlead_project') or is_granted('details_team_project'))")
*/
public function __invoke(Request $request, ProjectStatisticService $service, LocaleSettings $localeSettings)
public function __invoke(Request $request, ProjectStatisticService $service)
{
$dateFactory = $this->getDateTimeFactory();
$user = $this->getUser();