Merge branch 'MDL-38655' of git://github.com/aolley/moodle
This commit is contained in:
+7
-10
@@ -3203,12 +3203,12 @@ class assign {
|
||||
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,7 +3227,10 @@ class assign {
|
||||
public function can_view_submission($userid) {
|
||||
global $USER;
|
||||
|
||||
if (is_siteadmin()) {
|
||||
if (!$this->is_active_user($userid) && !has_capability('moodle/course:viewsuspendedusers', $this->context)) {
|
||||
return false;
|
||||
}
|
||||
if (has_capability('mod/assign:grade', $this->context)) {
|
||||
return true;
|
||||
}
|
||||
if (!is_enrolled($this->get_course_context(), $userid)) {
|
||||
@@ -3236,12 +3239,6 @@ class assign {
|
||||
if ($userid == $USER->id && has_capability('mod/assign:submit', $this->context)) {
|
||||
return true;
|
||||
}
|
||||
if (!$this->is_active_user($userid) && !has_capability('moodle/course:viewsuspendedusers', $this->context)) {
|
||||
return false;
|
||||
}
|
||||
if (has_capability('mod/assign:grade', $this->context)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user