-
Bug
-
Resolution: Fixed
-
Minor
-
2.5.6, 2.6.3, 2.7
-
MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
-
MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
-
git@github.com:danmarsden/moodle.git
-
master_
MDL-45583 -
if you set up a badge at course level and set it to be assignable by a single role it only checks course context roles.
$users = get_role_users($acceptedroles[0], $context, false, 'u.id', 'u.id ASC');
due to "false" being passed in 3rd param.
but if you select multiple roles it uses:
get_user_roles($context, $USER->id);
which checks parent contexts as well.
so if you have a role at site level that allows badges to be assigned and the user exists at the site level when they try to assign a badge at course level (and only one role is used) they get the error "your current role assignment is not among the roles that can manually issue this badge."