mirror of
https://github.com/moodle/moodle.git
synced 2025-08-02 23:59:41 +02:00
MDL-14696 Option to unenrol user from course when assigned to a role at a higher context; merged from MOODLE_19_STABLE
This commit is contained in:
parent
f06287ad2f
commit
d6094653ef
1 changed files with 1 additions and 1 deletions
|
@ -4610,7 +4610,7 @@ has_capability('moodle/course:viewhiddenuserfields', $context)) {
|
|||
$timemidnight = usergetmidnight(time());
|
||||
$output .= '<a href="'. $CFG->wwwroot .'/course/user.php?id='. $course->id .'&user='. $user->id .'">'. $string->activity .'</a><br />';
|
||||
}
|
||||
if (has_capability('moodle/role:assign', $context, NULL)) { // Includes admins
|
||||
if (has_capability('moodle/role:assign', $context) and get_user_roles($context, $user->id, false)) { // I can unassing and user has some role
|
||||
$output .= '<a href="'. $CFG->wwwroot .'/course/unenrol.php?id='. $course->id .'&user='. $user->id .'">'. $string->unenrol .'</a><br />';
|
||||
}
|
||||
if ($USER->id != $user->id && empty($USER->realuser) && has_capability('moodle/user:loginas', $context) &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue