diff options
| author | Moritz Strohm <strohm@data-quest.de> | 2025-07-24 08:28:42 +0000 |
|---|---|---|
| committer | Moritz Strohm <strohm@data-quest.de> | 2025-07-24 08:28:42 +0000 |
| commit | 706e2e7f9ece6ac166f1fc57cbb933a1538fd395 (patch) | |
| tree | f94007ef6a1523b513c970a668f913fad72afcc1 | |
| parent | 9e63aecd5c90779e76448e8b883635c80cbd2cb0 (diff) | |
group calendar: show the calendar items of the current user, too, fixes #5695
Closes #5695
Merge request studip/studip!4383
(cherry picked from commit 615f752aad7c0e1e1672e76a719dc7df523273ab)
99561e84 group calendar: show the calendar items of the current user, too
Co-authored-by: Moritz Strohm <strohm@data-quest.de>
| -rw-r--r-- | app/controllers/calendar/calendar.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/calendar/calendar.php b/app/controllers/calendar/calendar.php index c270ef4..1aa1ff8 100644 --- a/app/controllers/calendar/calendar.php +++ b/app/controllers/calendar/calendar.php @@ -623,11 +623,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; |
