aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2024-11-05 08:10:15 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2024-11-05 08:10:15 +0000
commit31480dbdf30e1b656ea702604f142aa5ee531da2 (patch)
tree8302401d8c57704bc7876d3227351a8726db4cfe /lib
parentcd04aafb62236cb8c578df37791f4a9bcb60e409 (diff)
correct calls to StructualElement::canRead(), fixes #4815
Closes #4815 Merge request studip/studip!3605
Diffstat (limited to 'lib')
-rw-r--r--lib/classes/globalsearch/GlobalSearchCourseware.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/classes/globalsearch/GlobalSearchCourseware.php b/lib/classes/globalsearch/GlobalSearchCourseware.php
index de069fe..1d34ad7 100644
--- a/lib/classes/globalsearch/GlobalSearchCourseware.php
+++ b/lib/classes/globalsearch/GlobalSearchCourseware.php
@@ -118,7 +118,7 @@ class GlobalSearchCourseware extends GlobalSearchModule implements GlobalSearchF
{
$structural_element = StructuralElement::find($data['id']);
$unit = $structural_element->findUnit();
- if ($unit && $structural_element->canRead($GLOBALS['user'])) {
+ if ($unit && $structural_element->canRead(User::findCurrent())) {
$description = '';
if ($data['type'] === 'cw_structural_elements') {
$description = self::mark($structural_element->payload['description'], $search, true);