From: moodler Date: Sun, 1 Oct 2006 05:27:36 +0000 (+0000) Subject: Fixed a bug where load_user_capability() was not checking in the X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9343a7333a8a73023275752388944a93869d8d38;p=moodle.git Fixed a bug where load_user_capability() was not checking in the specified context when it was provided (only in the parents) --- diff --git a/lib/accesslib.php b/lib/accesslib.php index d1e6f38b23..bd7d998af3 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -543,6 +543,7 @@ function load_user_capability($capability='', $context ='', $userid='') { if ($context) { // if context is specified $usercontexts = get_parent_contexts($context); + $usercontexts[] = $context->id; // Add the current context as well } else { // else, we load everything if ($userroles = get_records('role_assignments','userid',$userid)) { foreach ($userroles as $userrole) {