MDL-36369 qtypes and qbehaviour settings permissions.

The correct policy is that users with moodle/question:config can set the
default settings for particular qtypes. However, it requires
moodle/site:config in order to do manage qbehaviours or manage qtypes.
This commit is contained in:
Tim Hunt
2012-11-13 16:07:28 +00:00
parent e75324a53e
commit 837e181225
2 changed files with 7 additions and 5 deletions
+4 -2
View File
@@ -2924,9 +2924,11 @@ class plugininfo_qtype extends plugininfo_base {
$section = $this->get_settings_section_name();
$settings = null;
if ($hassiteconfig && file_exists($this->full_path('settings.php'))) {
$systemcontext = context_system::instance();
if (($hassiteconfig || has_capability('moodle/question:config', $systemcontext)) &&
file_exists($this->full_path('settings.php'))) {
$settings = new admin_settingpage($section, $this->displayname,
'moodle/site:config', $this->is_enabled() === false);
'moodle/question:config', $this->is_enabled() === false);
include($this->full_path('settings.php')); // this may also set $settings to null
}
if ($settings) {