MDL-17463 - reparate capabilities for course and admin reports

This commit is contained in:
skodak
2008-11-29 14:22:10 +00:00
parent 088a4df8fc
commit a2e4bf7f23
51 changed files with 527 additions and 169 deletions
+2 -2
View File
@@ -1371,13 +1371,13 @@ function stats_get_report_options($courseid,$mode) {
case STATS_MODE_DETAILED:
$reportoptions[STATS_REPORT_USER_ACTIVITY] = get_string('statsreport'.STATS_REPORT_USER_ACTIVITY);
$reportoptions[STATS_REPORT_USER_ALLACTIVITY] = get_string('statsreport'.STATS_REPORT_USER_ALLACTIVITY);
if (has_capability('moodle/site:viewreports', get_context_instance(CONTEXT_SYSTEM))) {
if (has_capability('coursereport/stats:view', get_context_instance(CONTEXT_SYSTEM))) {
$site = get_site();
$reportoptions[STATS_REPORT_USER_LOGINS] = get_string('statsreport'.STATS_REPORT_USER_LOGINS);
}
break;
case STATS_MODE_RANKED:
if (has_capability('moodle/site:viewreports', get_context_instance(CONTEXT_SYSTEM))) {
if (has_capability('coursereport/stats:view', get_context_instance(CONTEXT_SYSTEM))) {
$reportoptions[STATS_REPORT_ACTIVE_COURSES] = get_string('statsreport'.STATS_REPORT_ACTIVE_COURSES);
$reportoptions[STATS_REPORT_ACTIVE_COURSES_WEIGHTED] = get_string('statsreport'.STATS_REPORT_ACTIVE_COURSES_WEIGHTED);
$reportoptions[STATS_REPORT_PARTICIPATORY_COURSES] = get_string('statsreport'.STATS_REPORT_PARTICIPATORY_COURSES);