From aba5f469f6611ebea3f8a2c1403c05f395379e83 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Wed, 19 Sep 2007 07:54:06 +0000 Subject: [PATCH] accesslib: get_user_access_sitewide() was skipping rdefs The SQL query that would fetch rdefs not associated with any ra was not being executed. Duh! For example, a user with a teacher RA sitewide would never be affected by a role override at the category level, because it was not being loaded into accessdata. --- lib/accesslib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/accesslib.php b/lib/accesslib.php index 5105c101fc..ab086481d5 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -1242,6 +1242,8 @@ function get_user_access_sitewide($userid) { WHERE ra.userid = $userid AND sctx.contextlevel <= ".CONTEXT_COURSE." ORDER BY sctx.depth, sctx.path, ra.roleid"; + + $rs = get_recordset_sql($sql); if ($rs->RecordCount()) { while ($rd = rs_fetch_next_record($rs)) { $k = "{$rd->path}:{$rd->roleid}"; -- 2.39.5