diff --git a/app/controllers/resources/booking.php b/app/controllers/resources/booking.php index e0ebe28412e6b256d2ed1cfcfe1a72c510502034..72b28040e501d11a9c042685fdcbd6406cabd183 100644 --- a/app/controllers/resources/booking.php +++ b/app/controllers/resources/booking.php @@ -91,6 +91,18 @@ class Resources_BookingController extends AuthenticatedController ) || $this->make_comment_editable ); + $this->user_may_see_course_data = false; + if ($this->booking->getAssignedUserType() === 'course') { + $course = $this->booking->assigned_course_date->course; + if ($course instanceof Course) { + $has_perms = $GLOBALS['perm']->have_studip_perm('user', $course->id, $user->id); + $vis_perms = $GLOBALS['perm']->have_perm(Config::get()->SEM_VISIBILITY_PERM, $user->id); + if ($has_perms || $vis_perms || $course->visible) { + $this->user_may_see_course_data = true; + } + } + Seminar_Perm::get()->have_studip_perm('user', $this->booking->getAssignedUser()->id); + } if ($this->make_comment_editable && Request::submitted('save')) { CSRFProtection::verifyUnsafeRequest(); diff --git a/app/views/resources/booking/index.php b/app/views/resources/booking/index.php index bad981970a5cb309b996c7f9de7f0d1a3c29c8c0..3c56bd9ba5715314db279c2a8994b0ce5653238d 100644 --- a/app/views/resources/booking/index.php +++ b/app/views/resources/booking/index.php @@ -80,7 +80,7 @@ <? endif ?> <? endif ?> <? endif ?> - <? if ($booking->getAssignedUserType() === 'course'): ?> + <? if ($user_may_see_course_data): ?> <h3><?= _('Gebucht für:') ?></h3> <a href="<?= URLHelper::getScriptLink( 'dispatch.php/course/details/index/'