MDL-80565 report: Revert MDL-41465 changes

* Partial revert of changes made in MDL-41465,
while keeping the API changes made in enrol/lib.
This commit is contained in:
Laurent David
2024-03-11 14:30:54 +01:00
parent fde6c3c7ef
commit 0f235f56c1
4 changed files with 13 additions and 230 deletions
-11
View File
@@ -168,8 +168,6 @@ class report_loglive_renderable implements renderable {
* @return stdClass filters
*/
protected function setup_filters() {
global $USER;
$readers = $this->get_readers();
// Set up filters.
@@ -180,15 +178,6 @@ class report_loglive_renderable implements renderable {
if (!has_capability('moodle/site:viewanonymousevents', $context)) {
$filter->anonymous = 0;
}
if (groups_get_course_groupmode($this->course) == SEPARATEGROUPS &&
!has_capability('moodle/site:accessallgroups', $context)) {
if ($cgroups = groups_get_all_groups($this->course->id, $USER->id)) {
$filter->groups = [];
foreach ($cgroups as $cgroup) {
$filter->groups[] = (int)$cgroup->id;
}
}
}
} else {
$filter->courseid = 0;
}