mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
4f957b116d
With this patch, we respect rdef locality when two roles assignments in the same context have conflicting rdefs. In that case, the most local rdef wins. So RA locality still matters most. If you are a teacher sitewide and a student in course X, student role trumps teacher. For a use case, see the discussion here http://moodle.org/mod/forum/discuss.php?d=84472 Notes: - If we wanted to have locality of RDEF trump everything we can. A comment in this patch shows how. - I don't know how to reproduce this in pure SQL. And Also: This patch also fixes a bug where if CAP_PROHIBIT was set _and_ another role added to it in the same context, we would add or substract 1 to CAP_PROHIBIT, and it would lose its magic. And while at it, tighten the code to avoid casts. All the ints are unambiguously ints.