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.
This commit is contained in:
martinlanghoff
2007-09-19 07:54:06 +00:00
parent 53fb75dc1f
commit aba5f469f6
+2
View File
@@ -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}";