mirror of
https://github.com/moodle/moodle.git
synced 2025-04-15 05:25:08 +02:00
MDL-45583 badges: check parent contexts consistantly when checking required role.
This commit is contained in:
parent
c1ed254643
commit
dafb79106e
@ -120,7 +120,7 @@ if (count($acceptedroles) > 1) {
|
||||
}
|
||||
} else {
|
||||
// User has to be an admin or the one with the required role.
|
||||
$users = get_role_users($acceptedroles[0], $context, false, 'u.id', 'u.id ASC');
|
||||
$users = get_role_users($acceptedroles[0], $context, true, 'u.id', 'u.id ASC');
|
||||
$usersids = array_keys($users);
|
||||
if (!$isadmin && !in_array($USER->id, $usersids)) {
|
||||
echo $OUTPUT->header();
|
||||
|
Loading…
x
Reference in New Issue
Block a user