MDL-74664 mod_bigbluebuttonbn: Fix capabilty checking
* role::has_capability_in_course should check if course exist first
This commit is contained in:
@@ -119,7 +119,7 @@ class roles {
|
||||
*/
|
||||
public static function has_capability_in_course(int $courseid, string $capability) {
|
||||
global $DB;
|
||||
if (empty($courseid) || $DB->record_exists('course', ['id' => $courseid])) {
|
||||
if (empty($courseid) || !$DB->record_exists('course', ['id' => $courseid])) {
|
||||
return has_capability('moodle/site:config', \context_system::instance());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user