aboutsummaryrefslogtreecommitdiff
path: root/lib/models/RangeTreeNode.php
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2023-08-31 12:59:44 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2023-08-31 12:59:44 +0000
commitb4970cb1bdf2dfb58ae7bca3c7b7a01aff4d9026 (patch)
treefd165c368b2ca5aadafc3e7afafe4f5416aba1a3 /lib/models/RangeTreeNode.php
parentbcf449c0e054adcdfeacc3ba098f6c3357a4e69d (diff)
find only visible courses if not at least admin, fixes #3046
Closes #3046 Merge request studip/studip!2091
Diffstat (limited to 'lib/models/RangeTreeNode.php')
-rw-r--r--lib/models/RangeTreeNode.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/models/RangeTreeNode.php b/lib/models/RangeTreeNode.php
index d1c1823..4d52fed 100644
--- a/lib/models/RangeTreeNode.php
+++ b/lib/models/RangeTreeNode.php
@@ -146,6 +146,10 @@ class RangeTreeNode extends SimpleORMap implements StudipTreeNode
$parameters = ['ids' => $with_children ? $this->getDescendantIds() : [$this->id]];
}
+ if (!$GLOBALS['perm']->have_perm(Config::get()->SEM_VISIBILITY_PERM)) {
+ $query .= " AND s.`visible` = 1";
+ }
+
if ($semclass !== 0) {
$query .= " AND s.`status` IN (:types)";
$parameters['types'] = array_map(
@@ -200,6 +204,10 @@ class RangeTreeNode extends SimpleORMap implements StudipTreeNode
$parameters = ['ids' => $with_children ? $this->getDescendantIds() : [$this->id]];
}
+ if (!$GLOBALS['perm']->have_perm(Config::get()->SEM_VISIBILITY_PERM)) {
+ $query .= " AND s.`visible` = 1";
+ }
+
if ($searchterm) {
$query .= " AND s.`Name` LIKE :searchterm";
$parameters['searchterm'] = '%' . trim($searchterm) . '%';