From e70b5615c5115ad61f6abceafdb6c5686f96910a Mon Sep 17 00:00:00 2001 From: Sumaiya Javed Date: Tue, 17 Sep 2024 14:34:43 +1200 Subject: [PATCH] Remove view participants capability while creating dialogue --- classes/external/search_users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/external/search_users.php b/classes/external/search_users.php index f5922bb..6bbd70d 100644 --- a/classes/external/search_users.php +++ b/classes/external/search_users.php @@ -100,7 +100,7 @@ public static function execute(int $cmid, string $search, bool $searchanywhere, $exceptionparam->courseid = $params['courseid']; throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam); } - course_require_view_participants($context); + if (!has_capability('moodle/site:accessallgroups', $context) && $DB->record_exists('dialogue', ['id' => $cm->instance, 'usecoursegroups' => 1])) {