Skip to content

Commit

Permalink
MDL-14045
Browse files Browse the repository at this point in the history
Now respects mod/assignment:view
  • Loading branch information
thepurpleblob committed Jun 3, 2008
1 parent 455dfd5 commit 6d2d422
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mod/assignment/type/online/all.php
Expand Up @@ -24,6 +24,10 @@

require_course_login($course);

// check for view capability at course level
$context = get_context_instance(CONTEXT_COURSE,$course->id);
require_capability('mod/assignment:view',$context);

// various strings
$str = new stdClass;
$str->assignments = get_string("modulenameplural", "assignment");
Expand Down Expand Up @@ -69,6 +73,12 @@
continue;
}

// check we are allowed to view this
$context = get_context_instance(CONTEXT_MODULE, $assignment->coursemodule);
if (!has_capability('mod/assignment:view',$context)) {
continue;
}

// create instance of assignment class to get
// submitted assignments
$onlineinstance = new assignment_online( $assignment->coursemodule );
Expand Down

0 comments on commit 6d2d422

Please sign in to comment.