diff --git a/public/mod/bigbluebuttonbn/lib.php b/public/mod/bigbluebuttonbn/lib.php index e3470352ba2..b6c95d0bc52 100644 --- a/public/mod/bigbluebuttonbn/lib.php +++ b/public/mod/bigbluebuttonbn/lib.php @@ -576,18 +576,19 @@ function mod_bigbluebuttonbn_core_calendar_is_event_visible(calendar_event $even */ function bigbluebuttonbn_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $nodenav) { global $USER; - // Don't add validate completion if the callback for meetingevents is NOT enabled. - if (!(boolean) \mod_bigbluebuttonbn\local\config::get('meetingevents_enabled')) { - return; - } - // Don't add validate completion if user is not allowed to edit the activity. $context = context_module::instance($settingsnav->get_page()->cm->id); - if (!has_capability('moodle/course:manageactivities', $context, $USER->id)) { - return; + // Add validate completion if the callback for meetingevents is enabled and user is allowed to edit the activity. + if ( + (bool) \mod_bigbluebuttonbn\local\config::get('meetingevents_enabled') && + has_capability('moodle/course:manageactivities', $context, $USER->id) + ) { + $completionvalidate = '#action=completion_validate&bigbluebuttonbn=' . $settingsnav->get_page()->cm->instance; + $nodenav->add( + get_string('completionvalidatestate', 'bigbluebuttonbn'), + $completionvalidate, + navigation_node::TYPE_CONTAINER + ); } - $completionvalidate = '#action=completion_validate&bigbluebuttonbn=' . $settingsnav->get_page()->cm->instance; - $nodenav->add(get_string('completionvalidatestate', 'bigbluebuttonbn'), - $completionvalidate, navigation_node::TYPE_CONTAINER); } /**