]> git.mjollnir.org Git - moodle.git/commit
accesslib - role_switch() revamp, introduce get_role_access_bycontext()
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:05:32 +0000 (07:05 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:05:32 +0000 (07:05 +0000)
commit6f1bce30b1dd478a5638044ca9714df2a5a464a4
tree45d3f05a98e1dd5f667a457dc9543e06a771d3eb
parentb5a645b4ebd89bf1c305cf01b7eabe4ff556b042
accesslib - role_switch() revamp, introduce get_role_access_bycontext()

First stage of role_switch() rewrite - role_switch() sets up
a rsw entry in $USER->access, and makes sure we have the
appropriate role definitions in rdef.

That is where get_role_access_bycontext() comes into play -
gets all the rdef entries in one cheap sql query.

... though there may be many of them...

TODO:

 - fix callers of role_switch()
 - teach has_cap_fromsess() to read the rsw entries
lib/accesslib.php