From 615f752aad7c0e1e1672e76a719dc7df523273ab Mon Sep 17 00:00:00 2001 From: Moritz Strohm Date: Thu, 24 Jul 2025 08:27:57 +0000 Subject: group calendar: show the calendar items of the current user, too, fixes #5695 Closes #5695 Merge request studip/studip!4383 --- app/controllers/calendar/calendar.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/calendar/calendar.php b/app/controllers/calendar/calendar.php index 6e79d3a..70c1935 100644 --- a/app/controllers/calendar/calendar.php +++ b/app/controllers/calendar/calendar.php @@ -643,11 +643,15 @@ class Calendar_CalendarController extends AuthenticatedController $group = null; $users = []; if ($group_id) { + $current_user = User::findCurrent(); //Get the group first: $group = ContactGroup::find($group_id); - if ($group->owner_id !== User::findCurrent()->id) { + if ($group->owner_id !== $current_user->id) { throw new AccessDeniedException(); } + //Add the current user to the list of users so that they can see + //their own calendar in the group calendar, too: + $users[] = $current_user; foreach ($group->items as $item) { if ($item->user->isCalendarReadable()) { $users[] = $item->user; -- cgit v1.0