Moodle

Role unassignself not all implemented

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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

Hide
Petr Škoda (skodak) added a comment -

yes, this is intended behaviour, the unasign self was not intended to prevent accidental self unassignments.
sorry, closing as will not a bug

Petr

Show
Petr Škoda (skodak) added a comment - yes, this is intended behaviour, the unasign self was not intended to prevent accidental self unassignments. sorry, closing as will not a bug Petr

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: