From 9343a7333a8a73023275752388944a93869d8d38 Mon Sep 17 00:00:00 2001 From: moodler Date: Sun, 1 Oct 2006 05:27:36 +0000 Subject: [PATCH] Fixed a bug where load_user_capability() was not checking in the specified context when it was provided (only in the parents) --- lib/accesslib.php | 1 + 1 file changed, 1 insertion(+) 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) { -- 2.39.5