aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Strohm <strohm@data-quest.de>2025-07-24 08:27:57 +0000
committerMoritz Strohm <strohm@data-quest.de>2025-07-24 08:27:57 +0000
commit615f752aad7c0e1e1672e76a719dc7df523273ab (patch)
treec7ff8c307ac31e5583bca6cc389a59b0b1350070
parentf04e73f0544b802e612267b33d549b08ed83982b (diff)
group calendar: show the calendar items of the current user, too, fixes #5695
Closes #5695 Merge request studip/studip!4383
-rw-r--r--app/controllers/calendar/calendar.php6
1 files changed, 5 insertions, 1 deletions
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;