mirror of
https://github.com/moodle/moodle.git
synced 2025-04-25 10:26:17 +02:00
MDL-65852 user: Fix permission check to download course participants.
This commit is contained in:
parent
c8d33eb9ce
commit
b71615f5e2
@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
require_once("../config.php");
|
||||
require_once($CFG->dirroot . '/course/lib.php');
|
||||
|
||||
$formaction = required_param('formaction', PARAM_LOCALURL);
|
||||
$id = required_param('id', PARAM_INT);
|
||||
@ -78,7 +79,8 @@ if ($formaction == 'bulkchange.php') {
|
||||
|
||||
if (empty($plugin) AND $operationname == 'download_participants') {
|
||||
// Check permissions.
|
||||
if (has_capability('moodle/course:manageactivities', $context)) {
|
||||
$pagecontext = ($course->id == SITEID) ? context_system::instance() : $context;
|
||||
if (course_can_view_participants($pagecontext)) {
|
||||
$plugins = core_plugin_manager::instance()->get_plugins_of_type('dataformat');
|
||||
if (isset($plugins[$dataformat])) {
|
||||
if ($plugins[$dataformat]->is_enabled()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user