]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed a bug where load_user_capability() was not checking in the
authormoodler <moodler>
Sun, 1 Oct 2006 05:27:36 +0000 (05:27 +0000)
committermoodler <moodler>
Sun, 1 Oct 2006 05:27:36 +0000 (05:27 +0000)
specified context when it was provided (only in the parents)

lib/accesslib.php

index d1e6f38b23f9b32c81cbf6540452ad9baa8723d4..bd7d998af311ef04bb884080865d34f5049f76e7 100755 (executable)
@@ -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) {