Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Not a bug
-
Affects Version/s: 1.9.5
-
Fix Version/s: None
-
Component/s: Enrolments
-
Labels:None
-
Environment:1.9.5 moodle with a 8.2.4 postgres installed in a SUSE Linux Enterprise Server 10 SP1
-
Database:PostgreSQL
-
Affected Branches:MOODLE_19_STABLE
Description
If in the definition rol the admin make that teacher can't unenrol self from course, the "Unenrol me from...." link is not displayed, but the teacher can unenrol self using Assign roles module, and pressing "Remove" button.
For avoid this should modify the script:
moodle/admin/roles/assign.php
line: 230
where the code says this:
if ($topleveladmin && ($removeuser == $USER->id)) { // Prevent unassigning oneself from being admin
continue;
}
by this:
if (($topleveladmin && ($removeuser == $USER->id)) ||
(($removeuser == $USER->id) && !has_capability('moodle/role:unassignself', $context, $removeuser, false))
) { // Prevent unassigning oneself from being admin continue; } }
Cheers
Activity
- All
- Comments
- History
- Activity
- Source
- Test Sessions
yes, this is intended behaviour, the unasign self was not intended to prevent accidental self unassignments.
sorry, closing as will not a bug
Petr