Permalink
Browse files

MDL-39743 assign: Fix missing capability check for "grant extension"

  • Loading branch information...
1 parent 8daf98a commit e9efc2baa2377ef811a5b6f382f003c6ab1aba4e @ashleyholman ashleyholman committed with damyon May 29, 2013
Showing with 5 additions and 3 deletions.
  1. +1 −1 mod/assign/gradingbatchoperationsform.php
  2. +4 −2 mod/assign/locallib.php
View
2 mod/assign/gradingbatchoperationsform.php
@@ -49,7 +49,7 @@ public function definition() {
if ($instance['submissiondrafts']) {
$options['reverttodraft'] = get_string('reverttodraft', 'assign');
}
- if ($instance['duedate']) {
+ if ($instance['duedate'] && has_capability('mod/assign:grantextension', $instance['context'])) {
$options['grantextension'] = get_string('grantextension', 'assign');
}
if ($instance['attemptreopenmethod'] == ASSIGN_ATTEMPT_REOPEN_METHOD_MANUAL) {
View
6 mod/assign/locallib.php
@@ -2876,7 +2876,8 @@ protected function view_grading_table() {
'submissiondrafts'=>$this->get_instance()->submissiondrafts,
'duedate'=>$this->get_instance()->duedate,
'attemptreopenmethod'=>$this->get_instance()->attemptreopenmethod,
- 'feedbackplugins'=>$this->get_feedback_plugins());
+ 'feedbackplugins'=>$this->get_feedback_plugins(),
+ 'context'=>$this->get_context());
$classoptions = array('class'=>'gradingbatchoperationsform');
$gradingbatchoperationsform = new mod_assign_grading_batch_operations_form(null,
@@ -3152,7 +3153,8 @@ protected function process_grading_batch_operation(& $mform) {
'submissiondrafts'=>$this->get_instance()->submissiondrafts,
'duedate'=>$this->get_instance()->duedate,
'attemptreopenmethod'=>$this->get_instance()->attemptreopenmethod,
- 'feedbackplugins'=>$this->get_feedback_plugins());
+ 'feedbackplugins'=>$this->get_feedback_plugins(),
+ 'context'=>$this->get_context());
$formclasses = array('class'=>'gradingbatchoperationsform');
$mform = new mod_assign_grading_batch_operations_form(null,
$batchformparams,

0 comments on commit e9efc2b

Please sign in to comment.