Skip to content

Commit

Permalink
[MOODLE-19] add course filter
Browse files Browse the repository at this point in the history
  • Loading branch information
rs-a-demyanenko authored Feb 26, 2024
1 parent d2a84a0 commit 4a09b0f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions classes/log.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ public function get_module_list() {
*/
public function get_course_list() {
global $DB;
global $USER;

$courses = [];

Expand All @@ -358,6 +359,13 @@ public function get_course_list() {
}
}

if (!is_siteadmin($USER->id)) {
if (has_capability('availability/examus2:logaccess_course', $coursecontext) &&
!is_enrolled($coursecontext, $USER->id)) {
continue;
}
}

if ($course->id == SITEID) {
$courses[$course->id] = format_string($course->fullname) . ' (' . get_string('site') . ')';
} else {
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'availability_examus2';
$plugin->version = 2024020801;
$plugin->release = 'v2.0.32';
$plugin->version = 2024021401;
$plugin->release = 'v2.0.33';
$plugin->requires = 2018111800;
$plugin->maturity = MATURITY_STABLE;

0 comments on commit 4a09b0f

Please sign in to comment.