MDL-44725 Availability: Replace groupmembersonly - core_availability (2)
Remove groupmembersonly usage in the core_availability API, and change the update code (used in backup) so that it considers groupmembersonly when restoring old backups.
This commit is contained in:
@@ -113,8 +113,7 @@ class info_module extends info {
|
||||
* Checks if an activity is visible to the given user.
|
||||
*
|
||||
* Unlike other checks in the availability system, this check includes the
|
||||
* $cm->visible flag and also (if enabled) the groupmembersonly feature.
|
||||
* It is equivalent to $cm->uservisible.
|
||||
* $cm->visible flag. It is equivalent to $cm->uservisible.
|
||||
*
|
||||
* If you have already checked (or do not care whether) the user has access
|
||||
* to the course, you can set $checkcourse to false to save it checking
|
||||
@@ -160,11 +159,6 @@ class info_module extends info {
|
||||
$cm = $DB->get_record('course_modules', array('id' => $cmorid), '*', MUST_EXIST);
|
||||
}
|
||||
|
||||
// Check the groupmembersonly feature.
|
||||
if (!groups_course_module_visible($cm, $userid)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If requested, check user can access the course.
|
||||
if ($checkcourse) {
|
||||
$coursecontext = \context_course::instance($cm->course);
|
||||
|
||||
Reference in New Issue
Block a user