]> git.mjollnir.org Git - moodle.git/commit
accesslib: initial has_capability() rewrite
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:02:31 +0000 (07:02 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:02:31 +0000 (07:02 +0000)
commit7f97ea29bf7b6ef1f1ebc36907bb0e4ddb5f951b
treee4320869c6e802d7411f4f29261200daf8c79b6e
parent6dd34e935d9df3e6766caf6b9ca83a47f1660064
accesslib: initial has_capability() rewrite

 - has_capability() renamed has_capability_old() and we fallback
   when we cannot answer the question

 - has_capability() works great for the course-and-above contexts
   for the logged in user - does not touch the DB

 - works based on $USER->access which has a pretty compact view
   of the user's access rights...

TODO:

 - deal with contexts below the course - here we need to
   trigger the role-assignment and role-defs load when needed

 - deal with "other" contexts that hang from the system context

 - deal with global roleswitch, local roleswitch
lib/accesslib.php