forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-60983 get_user_capability_course: fix buggy edge cases
There were basically two problems, which are demostrated by the new test users u7 and u8 in the unit test. 1. There was a problem if a role was overridden in a context above the one where it was assigned. E.g. User has teacher role in a course, and there is a role override in the course-category context. That was being ignored. 2. Problems with the handling of PROHIBITs. It should be the case that if there is a PROHIBIT in force, then it cannot be overridden by another role, or by a role override. However, this was not working in all cases. Also, I had to add comments to the unit test so that I could understand it. Hopefully these will be hepful to other developers too.
- Loading branch information
Showing
2 changed files
with
111 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters