Commit 3032ac67 authored by Jacob Priddy's avatar Jacob Priddy 👌

Merge branch 'display-group-on-access-reason' into 'master'

Add group number for more helpful messages

See merge request !95
parents 5abd428c a159fb71
Pipeline #13130 passed with stages
in 3 minutes and 5 seconds
......@@ -30,7 +30,8 @@ class ScheduleAuthorizer implements AccessAuthorizer
*/
protected GroupScheduleRepository $groupSchedule;
protected int $allowedSchedule = 0;
protected int $acceptedSchedule = 0;
protected int $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;
}
}
Markdown is supported
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