]> git.mjollnir.org Git - moodle.git/commit
accesslib: get_user_by_capability() - Move capcheck to has_capability_from_rarc()
authormartinlanghoff <martinlanghoff>
Sun, 6 Jan 2008 23:24:25 +0000 (23:24 +0000)
committermartinlanghoff <martinlanghoff>
Sun, 6 Jan 2008 23:24:25 +0000 (23:24 +0000)
commit6c9d86b7a61b1553565417927f41b80cb2a4c189
tree6cf430157650aaf0845c36233038fd0e4bea4bb4
parentd2c5b7a9fa599d2d4fd47044a1aea0d69000070f
accesslib: get_user_by_capability() - Move capcheck to has_capability_from_rarc()

This fixes the handling of default roles as "tie breakers" for lower
RAs in conflict, and simplifies the code a lot.

The main loop in get_user_by_capability() runs a simpler state machine
that just collects role assignments (roleid and depth), and handles
pagination.

The complex part of the state machine has moved to
has_capability_from_rarc() which will walk the data structures
collected by get_user_by_capability() for each user.

Having all the complex state handling of $hascap there makes things a
lot easier for pagination and general sanity of
get_user_by_capability().

MDL-12452
lib/accesslib.php