Permalink
Browse files

Merge branch 'MDL-38655' of git://github.com/aolley/moodle

  • Loading branch information...
danpoltawski committed Oct 8, 2013
2 parents b242214 + c447c03 commit 6cd7df4df1749a9d937b047e76fba1042574d2ee
Showing with 7 additions and 10 deletions.
  1. +7 −10 mod/assign/locallib.php
View
@@ -3203,12 +3203,12 @@ protected function is_graded($userid) {
public function can_view_group_submission($groupid) {
global $USER;
if (!is_enrolled($this->get_course_context(), $USER->id)) {
return false;
}
if (has_capability('mod/assign:grade', $this->context)) {
return true;
}
if (!is_enrolled($this->get_course_context(), $USER->id)) {
return false;
}
$members = $this->get_submission_group_members($groupid, true);
foreach ($members as $member) {
if ($member->id == $USER->id) {
@@ -3227,19 +3227,16 @@ public function can_view_group_submission($groupid) {
public function can_view_submission($userid) {
global $USER;
if (is_siteadmin()) {
return true;
}
if (!is_enrolled($this->get_course_context(), $userid)) {
if (!$this->is_active_user($userid) && !has_capability('moodle/course:viewsuspendedusers', $this->context)) {
return false;
}
if ($userid == $USER->id && has_capability('mod/assign:submit', $this->context)) {
if (has_capability('mod/assign:grade', $this->context)) {
return true;
}
if (!$this->is_active_user($userid) && !has_capability('moodle/course:viewsuspendedusers', $this->context)) {
if (!is_enrolled($this->get_course_context(), $userid)) {
return false;
}
if (has_capability('mod/assign:grade', $this->context)) {
if ($userid == $USER->id && has_capability('mod/assign:submit', $this->context)) {
return true;
}
return false;

0 comments on commit 6cd7df4

Please sign in to comment.