From 4ee33d21ac5aa8cc8b160b96b56d8f8064be6b3f Mon Sep 17 00:00:00 2001 From: Jesus Federico Date: Thu, 21 Feb 2019 13:02:40 -0500 Subject: [PATCH] CONTRIB-7627: Fix for participation rules for users applied as rules for roles (#116) --- locallib.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/locallib.php b/locallib.php index f3c346587..eb4a17dfd 100644 --- a/locallib.php +++ b/locallib.php @@ -865,15 +865,18 @@ function bigbluebuttonbn_is_moderator_validate_rule($participant, $userid, $user if ($participant['role'] == BIGBLUEBUTTONBN_ROLE_VIEWER) { return false; } - // Looks for all configuration. + // Validation for the 'all' rule. if ($participant['selectiontype'] == 'all') { return true; } - // Looks for users. - if ($participant['selectiontype'] == 'user' && $participant['selectionid'] == $userid) { - return true; + // Validation for a 'user' rule. + if ($participant['selectiontype'] == 'user') { + if ($participant['selectionid'] == $userid) { + return true; + } + return false; } - // Looks for roles. + // Validation for a 'role' rule. $role = bigbluebuttonbn_get_role($participant['selectionid']); if ($role != null && array_key_exists($role->id, $userroles)) { return true;