Commit 38737859 authored by Jacob Priddy's avatar Jacob Priddy 👌
Browse files

Add group number for more helpful messages

parent 5abd428c
Pipeline #12942 failed with stages
in 1 minute and 42 seconds
......@@ -30,7 +30,8 @@ class ScheduleAuthorizer implements AccessAuthorizer
*/
protected GroupScheduleRepository $groupSchedule;
protected int $allowedSchedule = 0;
protected string $acceptedSchedule = 0;
protected string $acceptedGroup = 0;
public function __construct(
GroupScheduleRepository $groupSchedule,
......@@ -65,7 +66,8 @@ class ScheduleAuthorizer implements AccessAuthorizer
}
if ($this->recurrenceSet->occurrenceHappeningAtDate($date, $schedule->getDuration())) {
$this->allowedSchedule = $schedule->getId();
$this->acceptedSchedule = $schedule->getId();
$this->acceptedGroup = $group->getId();
return self::ALLOW;
}
}
......@@ -81,6 +83,6 @@ class ScheduleAuthorizer implements AccessAuthorizer
public function getReason(): string
{
// We only allow, can only be one reason.
return 'Allowed by user access schedule: ' . $this->allowedSchedule;
return 'Allowed through group ' . $this->acceptedGroup . ' via schedule ' . $this->acceptedSchedule;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment