martinlanghoff 4f957b116d accesslib: has_capability_in_accessdata() respects rdef locality a bit more
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.
2007-11-20 00:18:31 +00:00
..
2007-11-14 01:25:20 +00:00
2007-09-20 12:26:58 +00:00
2007-01-23 05:19:28 +00:00
2007-07-07 14:18:30 +12:00
2007-10-10 05:25:14 +00:00
2007-01-24 07:08:50 +00:00
2007-08-29 13:10:20 +12:00
2007-10-10 05:25:14 +00:00
2007-09-17 12:37:51 +00:00
2007-10-10 05:25:14 +00:00
2007-05-20 11:20:49 +00:00