MDL-36369 Question types and behaviour settings should not require moodle/site:config
This commit is contained in:
@@ -312,6 +312,10 @@ if ($hassiteconfig) {
|
||||
|
||||
// Question type settings
|
||||
if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext)) {
|
||||
if (!$hassiteconfig) {
|
||||
require_once("$CFG->libdir/pluginlib.php");
|
||||
$allplugins = plugin_manager::instance()->get_plugins();
|
||||
}
|
||||
// Question behaviour settings.
|
||||
$ADMIN->add('modules', new admin_category('qbehavioursettings', new lang_string('questionbehaviours', 'admin')));
|
||||
$ADMIN->add('qbehavioursettings', new admin_page_manageqbehaviours());
|
||||
|
||||
+3
-2
@@ -5252,7 +5252,7 @@ class admin_page_manageqbehaviours extends admin_externalpage {
|
||||
public function __construct() {
|
||||
global $CFG;
|
||||
parent::__construct('manageqbehaviours', get_string('manageqbehaviours', 'admin'),
|
||||
new moodle_url('/admin/qbehaviours.php'));
|
||||
new moodle_url('/admin/qbehaviours.php'), 'moodle/question:config');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5299,7 +5299,8 @@ class admin_page_manageqtypes extends admin_externalpage {
|
||||
*/
|
||||
public function __construct() {
|
||||
global $CFG;
|
||||
parent::__construct('manageqtypes', get_string('manageqtypes', 'admin'), "$CFG->wwwroot/$CFG->admin/qtypes.php");
|
||||
parent::__construct('manageqtypes', get_string('manageqtypes', 'admin'), "$CFG->wwwroot/$CFG->admin/qtypes.php",
|
||||
'moodle/question:config');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user