]> git.mjollnir.org Git - moodle.git/commit
accesslib: get_user_by_capability() - Handle the complex case
authormartinlanghoff <martinlanghoff>
Sun, 6 Jan 2008 23:23:58 +0000 (23:23 +0000)
committermartinlanghoff <martinlanghoff>
Sun, 6 Jan 2008 23:23:58 +0000 (23:23 +0000)
commita4436c6db84a71ac468c925a27bd99b8d26f61a8
tree94d37ee6b8d4f5b38cb1a9364a3f7581479229cb
parent2d1669b0d559e09ea837b694ef5ccf7fcf1b29f1
accesslib: get_user_by_capability() - Handle the complex case

With this commit, we can handle the complex cases with

 - correct pagination, but not very efficient over large datasets

 - mostly-correct application of the override rules

The structure of the code is fairly complex in that we want to do
it without holding all the recs in memory, so we use a small state
machine. We have to handle the complex override rules over 1 or 2
permissions (when $doanything is set) so it all ends up quite complex.

There is one known issue with this code, in cases where the default
role ends up as the decider between 2 conflicting RAs, we fail to
apply it. This will need a bit of reorg of how the loop works.

MDL-12452
lib/accesslib.php