mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-18985 improved group access control in gradebook exports
This commit is contained in:
parent
1dc9f2e291
commit
5b36bcba00
5 changed files with 21 additions and 0 deletions
|
@ -45,6 +45,11 @@ $context = get_context_instance(CONTEXT_COURSE, $id);
|
|||
require_capability('moodle/grade:export', $context);
|
||||
require_capability('gradeexport/ods:view', $context);
|
||||
|
||||
if (groups_get_course_groupmode($COURSE) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) {
|
||||
if (!groups_is_member($groupid, $USER->id)) {
|
||||
print_error('cannotaccessgroup', 'grades');
|
||||
}
|
||||
}
|
||||
|
||||
// print all the exported data here
|
||||
$export = new grade_export_ods($course, $groupid, $itemids, $export_feedback, $updatedgradesonly, $displaytype, $decimalpoints);
|
||||
|
|
|
@ -46,6 +46,11 @@ $context = get_context_instance(CONTEXT_COURSE, $id);
|
|||
require_capability('moodle/grade:export', $context);
|
||||
require_capability('gradeexport/txt:view', $context);
|
||||
|
||||
if (groups_get_course_groupmode($COURSE) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) {
|
||||
if (!groups_is_member($groupid, $USER->id)) {
|
||||
print_error('cannotaccessgroup', 'grades');
|
||||
}
|
||||
}
|
||||
|
||||
// print all the exported data here
|
||||
$export = new grade_export_txt($course, $groupid, $itemids, $export_feedback, $updatedgradesonly, $displaytype, $decimalpoints, $separator);
|
||||
|
|
|
@ -45,6 +45,11 @@ $context = get_context_instance(CONTEXT_COURSE, $id);
|
|||
require_capability('moodle/grade:export', $context);
|
||||
require_capability('gradeexport/xls:view', $context);
|
||||
|
||||
if (groups_get_course_groupmode($COURSE) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) {
|
||||
if (!groups_is_member($groupid, $USER->id)) {
|
||||
print_error('cannotaccessgroup', 'grades');
|
||||
}
|
||||
}
|
||||
|
||||
// print all the exported data here
|
||||
$export = new grade_export_xls($course, $groupid, $itemids, $export_feedback, $updatedgradesonly, $displaytype, $decimalpoints);
|
||||
|
|
|
@ -45,6 +45,11 @@ $context = get_context_instance(CONTEXT_COURSE, $id);
|
|||
require_capability('moodle/grade:export', $context);
|
||||
require_capability('gradeexport/xml:view', $context);
|
||||
|
||||
if (groups_get_course_groupmode($COURSE) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context)) {
|
||||
if (!groups_is_member($groupid, $USER->id)) {
|
||||
print_error('cannotaccessgroup', 'grades');
|
||||
}
|
||||
}
|
||||
|
||||
// print all the exported data here
|
||||
$export = new grade_export_xml($course, $groupid, $itemids, $export_feedback, $updatedgradesonly, $displaytype, $decimalpoints);
|
||||
|
|
|
@ -62,6 +62,7 @@ $string['calculationadd'] = 'Add calculation';
|
|||
$string['calculationedit'] = 'Edit calculation';
|
||||
$string['calculationview'] = 'View calculation';
|
||||
$string['calculationsaved'] = 'Calculation saved';
|
||||
$string['cannotaccessgroup'] = 'Can not access grades of selected group, sorry.';
|
||||
$string['categories'] = 'Categories';
|
||||
$string['categoriesanditems'] = 'Categories and items';
|
||||
$string['categoriesedit'] = 'Edit categories and items';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue