-
Sub-task
-
Resolution: Fixed
-
Minor
-
2.0
-
None
-
MOODLE_20_STABLE
-
MOODLE_20_STABLE
-
Easy
When restoring one course we need to know the roles that are assignable by a given user. That's addressed by the get_assignable_roles() function.
The problem is that the function always returns the assignable roles for the current session user ($USER). And restore requires all permissions to be evaluated by the given user (that for sure will match $USER on interactive executions but can be different in other types of executions - cron/customs...).
So I'm going to modify the get_assignable_roles() function, 100% BC
- adding one new 4th parameter $user (default null)
- if null, $USER will be used
- if object/id, $user will be used
Ciao
- has been marked as being related by
-
MDL-23109 restore: ui
- Closed