mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-17464 profile reports are now respecting course report caps
This commit is contained in:
parent
683dacd065
commit
358e2a0bd2
8 changed files with 140 additions and 54 deletions
|
@ -49,8 +49,20 @@ $coursereport_log_capabilities = array(
|
|||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/site:viewreports',
|
||||
)
|
||||
),
|
||||
|
||||
'coursereport/log:viewtoday' => array(
|
||||
'riskbitmask' => RISK_PERSONAL,
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_COURSE,
|
||||
'legacy' => array(
|
||||
'teacher' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'admin' => CAP_ALLOW
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/site:viewreports',
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
|
|
|
@ -17,9 +17,7 @@
|
|||
require_login($course);
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
|
||||
if ($course->showreports and $USER->id == $user and !isguestuser()) {
|
||||
// no cap required to view own graph
|
||||
} else {
|
||||
if (!$course->showreports or $USER->id != $user) {
|
||||
require_capability('coursereport/log:view', $context);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
// //
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$plugin->version = 2007101502;
|
||||
$plugin->version = 2007101503;
|
||||
$plugin->requires = 2007101532;
|
||||
|
||||
?>
|
||||
|
|
|
@ -24,7 +24,9 @@
|
|||
require_login($course);
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
|
||||
require_capability('coursereport/stats:view', $context);
|
||||
if (!$course->showreports or $USER->id != $userid) {
|
||||
require_capability('coursereport/stats:view', $context);
|
||||
}
|
||||
|
||||
stats_check_uptodate($course->id);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue