added new permission to separate time and money budget (#3352)

This commit is contained in:
Kevin Papst
2022-06-11 12:23:02 +02:00
committed by GitHub
parent 3f827b3104
commit b46fdcefad
47 changed files with 853 additions and 346 deletions

View File

@@ -133,7 +133,7 @@ final class ActivityController extends AbstractController
$rates = $rateRepository->getRatesForActivity($activity);
}
if ($this->isGranted('budget', $activity)) {
if ($this->isGranted('budget', $activity) || $this->isGranted('time', $activity)) {
$stats = $statisticService->getBudgetStatisticModel($activity, $now);
}
@@ -424,7 +424,8 @@ final class ActivityController extends AbstractController
'action' => $url,
'method' => 'POST',
'currency' => $currency,
'include_budget' => $this->isGranted('budget', $activity)
'include_budget' => $this->isGranted('budget', $activity),
'include_time' => $this->isGranted('time', $activity),
]);
}
}

View File

@@ -315,7 +315,7 @@ final class CustomerController extends AbstractController
$timezone = new \DateTimeZone($customer->getTimezone());
}
if ($this->isGranted('budget', $customer)) {
if ($this->isGranted('budget', $customer) || $this->isGranted('time', $customer)) {
$stats = $statisticService->getBudgetStatisticModel($customer, $now);
}
@@ -530,7 +530,8 @@ final class CustomerController extends AbstractController
return $this->createForm(CustomerEditForm::class, $customer, [
'action' => $url,
'method' => 'POST',
'include_budget' => $this->isGranted('budget', $customer)
'include_budget' => $this->isGranted('budget', $customer),
'include_time' => $this->isGranted('time', $customer),
]);
}
}

View File

@@ -333,7 +333,7 @@ final class ProjectController extends AbstractController
$rates = $rateRepository->getRatesForProject($project);
}
if ($this->isGranted('budget', $project)) {
if ($this->isGranted('budget', $project) || $this->isGranted('time', $project)) {
$stats = $statisticService->getBudgetStatisticModel($project, $now);
}
@@ -563,6 +563,7 @@ final class ProjectController extends AbstractController
'currency' => $currency,
'timezone' => $this->getDateTimeFactory()->getTimezone()->getName(),
'include_budget' => $this->isGranted('budget', $project),
'include_time' => $this->isGranted('time', $project),
'time_increment' => 15,
]);
}

View File

@@ -22,7 +22,7 @@ final class ProjectDateRangeController extends AbstractController
{
/**
* @Route(path="/reporting/project_daterange", name="report_project_daterange", methods={"GET","POST"})
* @Security("is_granted('view_reporting') and is_granted('budget_project')")
* @Security("is_granted('view_reporting') and is_granted('budget_any', 'project')")
*/
public function __invoke(Request $request, ProjectStatisticService $service)
{

View File

@@ -22,7 +22,7 @@ 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') or is_granted('details_teamlead_project') or is_granted('details_team_project'))")
* @Security("is_granted('view_reporting') and is_granted('details', 'project')")
*/
public function __invoke(Request $request, ProjectStatisticService $service)
{

View File

@@ -21,7 +21,7 @@ final class ProjectInactiveController extends AbstractController
{
/**
* @Route(path="/reporting/project_inactive", name="report_project_inactive", methods={"GET","POST"})
* @Security("is_granted('view_reporting') and is_granted('budget_project')")
* @Security("is_granted('view_reporting') and is_granted('budget_any', 'project')")
*/
public function __invoke(Request $request, ProjectStatisticService $service)
{

View File

@@ -21,7 +21,7 @@ final class ProjectViewController extends AbstractController
{
/**
* @Route(path="/reporting/project_view", name="report_project_view", methods={"GET","POST"})
* @Security("is_granted('view_reporting') and is_granted('budget_project')")
* @Security("is_granted('view_reporting') and is_granted('budget_any', 'project')")
*/
public function __invoke(Request $request, ProjectStatisticService $service)
{