]> git.mjollnir.org Git - moodle.git/commitdiff
accesslib: get_user_access_sitewide() was skipping rdefs
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:54:06 +0000 (07:54 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:54:06 +0000 (07:54 +0000)
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

index 5105c101fcb96fc301a783ba7d3ae35531312c2c..ab086481d56514b8ef6703763b7ae098fa1693cd 100755 (executable)
@@ -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}";