MDL-66213 report_log: Show anonymous events when capability allows.
This commit is contained in:
@@ -504,7 +504,14 @@ class report_log_table_log extends table_sql {
|
||||
|
||||
if (!($this->filterparams->logreader instanceof logstore_legacy\log\store)) {
|
||||
// Filter out anonymous actions, this is N/A for legacy log because it never stores them.
|
||||
$joins[] = "anonymous = 0";
|
||||
if ($this->filterparams->modid) {
|
||||
$context = context_module::instance($this->filterparams->modid);
|
||||
} else {
|
||||
$context = context_course::instance($this->filterparams->courseid);
|
||||
}
|
||||
if (!has_capability('moodle/site:viewanonymousevents', $context)) {
|
||||
$joins[] = "anonymous = 0";
|
||||
}
|
||||
}
|
||||
|
||||
$selector = implode(' AND ', $joins);
|
||||
|
||||
Reference in New Issue
Block a user