mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
MDL-38096 fix availability of bulk enrol actions
This commit is contained in:
parent
506338d5de
commit
0f39498480
1 changed files with 8 additions and 4 deletions
|
@ -438,10 +438,14 @@ class enrol_manual_plugin extends enrol_plugin {
|
||||||
public function get_bulk_operations(course_enrolment_manager $manager) {
|
public function get_bulk_operations(course_enrolment_manager $manager) {
|
||||||
global $CFG;
|
global $CFG;
|
||||||
require_once($CFG->dirroot.'/enrol/manual/locallib.php');
|
require_once($CFG->dirroot.'/enrol/manual/locallib.php');
|
||||||
$bulkoperations = array(
|
$context = $manager->get_context();
|
||||||
'editselectedusers' => new enrol_manual_editselectedusers_operation($manager, $this),
|
$bulkoperations = array();
|
||||||
'deleteselectedusers' => new enrol_manual_deleteselectedusers_operation($manager, $this)
|
if (has_capability("enrol/manual:manage", $context)) {
|
||||||
);
|
$bulkoperations['editselectedusers'] = new enrol_manual_editselectedusers_operation($manager, $this);
|
||||||
|
}
|
||||||
|
if (has_capability("enrol/manual:unenrol", $context)) {
|
||||||
|
$bulkoperations['deleteselectedusers'] = new enrol_manual_deleteselectedusers_operation($manager, $this);
|
||||||
|
}
|
||||||
return $bulkoperations;
|
return $bulkoperations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue