Merge branch 'MDL-57362-master' of git://github.com/ankitagarwal/moodle

This commit is contained in:
Dan Poltawski
2017-03-06 10:27:10 -03:00
+7 -3
View File
@@ -3064,7 +3064,7 @@ class assign {
* Throw an error if the permissions to view this users submission are missing.
*
* @throws required_capability_exception
* @return none
* @return void
*/
public function require_view_submission($userid) {
if (!$this->can_view_submission($userid)) {
@@ -3076,7 +3076,7 @@ class assign {
* Throw an error if the permissions to view grades in this assignment are missing.
*
* @throws required_capability_exception
* @return none
* @return void
*/
public function require_view_grades() {
if (!$this->can_view_grades()) {
@@ -3094,7 +3094,11 @@ class assign {
if (!has_any_capability(array('mod/assign:viewgrades', 'mod/assign:grade'), $this->context)) {
return false;
}
// Checks for the edge case when user belongs to no groups and groupmode is sep.
if ($this->get_course_module()->effectivegroupmode == SEPARATEGROUPS) {
$groupflag = !empty(groups_get_activity_allowed_groups($this->get_course_module()));
return (bool)$groupflag;
}
return true;
}