]> git.mjollnir.org Git - moodle.git/commit
accesslib: has_capability() now works for the logged in user
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:02:44 +0000 (07:02 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:02:44 +0000 (07:02 +0000)
commit74ac5b66cbfb458524fa9b7db2454f00091cde23
tree9b2a1ae0955571a71f30322006aa265f98fd1e2d
parent7f97ea29bf7b6ef1f1ebc36907bb0e4ddb5f951b
accesslib: has_capability() now works for the logged in user

With this commit, the new has_capability works for the logged
in user correctly.

 - load_all_capabilities() no longer calls load_user_capability()!
   6K dbqueries less on login... ;-)

 - When delving into a context we haven't loaded yet, we call
   get_user_access_bycontext()

 - Introduce: get_user_access_bycontext()

 - Several fixes in get_user_access_sitewide()
   (renamed from get_user_sitewide_access())

 - Fixes in has_cap_fromsess()

 - Introduce access_insess() to check if we have to call
   get_user_access_bycontext() for the context
lib/accesslib.php