From eddacaf78aa094ceb1d29919bcf5250793ccc5f1 Mon Sep 17 00:00:00 2001 From: Philipp Memmel Date: Fri, 20 Dec 2024 21:35:49 +0100 Subject: [PATCH] MBS-9808: Fix role filter in case of no users exist with filtered role(s) --- classes/local/rights_config_table.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/classes/local/rights_config_table.php b/classes/local/rights_config_table.php index 52448e4..4822b04 100644 --- a/classes/local/rights_config_table.php +++ b/classes/local/rights_config_table.php @@ -94,6 +94,9 @@ public function __construct( if (!empty($roleuserids)) { [$insql, $roleparams] = $DB->get_in_or_equal($roleuserids, SQL_PARAMS_NAMED); $rolewhere = ' AND u.id ' . $insql; + } else { + // We could not find any user with the roles in the filter, so we need to return no entries. + $rolewhere = ' AND FALSE '; } }