Skip to content

Commit

Permalink
Removed duplicate capability moodle/course:managequestions MDL-6610
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Sep 28, 2006
1 parent 9e27d59 commit 2d14e8a
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 21 deletions.
2 changes: 1 addition & 1 deletion blocks/admin/block_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function get_content() {
}

/// Manage questions
if (has_capability('moodle/course:managequestions', $context)) {
if (has_capability('moodle/question:manage', $context)) {
$this->content->items[]='<a href="'.$CFG->wwwroot.'/question/edit.php?courseid='.$this->instance->pageid.'&amp;clean=true">'.get_string('questions', 'quiz').'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/questions.gif" alt="" />';
}
Expand Down
1 change: 0 additions & 1 deletion lang/en_utf8/role.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
$string['course:managegroups'] = 'Manage groups';
$string['course:managefiles'] = 'Manage files';
$string['course:managemetacourse'] = 'Manage metacourse';
$string['course:managequestions'] = 'Manage questions';
$string['course:reset'] = 'Reset course';
$string['course:sectionvisibility'] = 'Control section visibility';
$string['course:viewhiddensections'] = 'View hidden sections';
Expand Down
16 changes: 0 additions & 16 deletions lib/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -629,22 +629,6 @@
)
),

'moodle/course:managequestions' => array(

'riskbitmask' => RISK_XSS,

'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'legacy' => array(
'guest' => CAP_PREVENT,
'student' => CAP_PREVENT,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),

'moodle/course:manageactivities' => array(

'riskbitmask' => RISK_XSS,
Expand Down
2 changes: 1 addition & 1 deletion question/editlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function question_category_menu($courseid, $published=false) {
$publish = "OR publish = '1'";
}

if (!has_capability('moodle/course:managequestions', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (!has_capability('moodle/question:manage', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
$categories = get_records_select("question_categories", "course = '$courseid' $publish", 'parent, sortorder, name ASC');
} else {
$categories = get_records_select("question_categories", '', 'parent, sortorder, name ASC');
Expand Down
2 changes: 1 addition & 1 deletion question/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
print_heading_with_help($txt->importquestions, "import", "quiz");

/// Get all the existing categories now
if (has_capability('moodle/course:managequestions', get_context_instance(CONTEXT_SYSTEM, SITEID))) { // the admin can import into all categories
if (has_capability('moodle/question:manage', get_context_instance(CONTEXT_SYSTEM, SITEID))) { // the admin can import into all categories
if (!$categories = get_records_select("question_categories", "course = '{$course->id}' OR publish = '1'", "parent, sortorder, name ASC")) {
error("Could not find any question categories!"); // Something is really wrong
}
Expand Down
2 changes: 1 addition & 1 deletion question/type/rqp/types.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// Check user admin
require_login();
require_capability('moodle/course:managequestions', get_context_instance(CONTEXT_SYSTEM, SITEID));
require_capability('moodle/question:manage', get_context_instance(CONTEXT_SYSTEM, SITEID));

if (!$site = get_site()) {
error('Site isn\'t defined!');
Expand Down

0 comments on commit 2d14e8a

Please sign in to comment.