]> git.mjollnir.org Git - moodle.git/commit
accesslib: default, guest and notloggedin roles work properly now
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:02:57 +0000 (07:02 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:02:57 +0000 (07:02 +0000)
commite0376a6241256db39e04a2941200fe2119500466
tree5e81d2d3a7e56c4916a2b4be29a14a3e98c56882
parent74ac5b66cbfb458524fa9b7db2454f00091cde23
accesslib: default, guest and notloggedin roles work properly now

Changes around load_user_capability() and has_capability() to make
the default role fallbacks and guest/nonloggedin roles work.

This commit also introduces the concept of having a magic
context next to the root context in $USER->access[ra], as

 $USER->access[ra][/1] = 1 (admin roleid)
 $USER->access[ra][/1:def] = 7 (loggedinuser roleid)

and has_cap_fromsess() now checks for that magic context
as well.
lib/accesslib.php