Permalink
Browse files

moodlelib: sync_metacourse MDL-20626 wasn't respecting hidden role as…

…signments

This causes hidden role assignments to become public on metacourses

Many thanks to Daniel Neis for the patch

Signed-off-by: Dan Poltawski <dan.poltawski@luns.net.uk>
  • Loading branch information...
danpoltawski committed Feb 24, 2010
1 parent f6674e2 commit 47e32d2955229f205743a0a84de951095fb1cd49
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/moodlelib.php
View
@@ -2490,7 +2490,7 @@ function sync_metacourse($course) {
// not in the meta coure. That is, get a list of the assignments that need to be made.
if (!$assignments = get_records_sql("
SELECT
- ra.id, ra.roleid, ra.userid
+ ra.id, ra.roleid, ra.userid, ra.hidden
FROM
{$CFG->prefix}role_assignments ra,
{$CFG->prefix}context con,
@@ -2551,7 +2551,7 @@ function sync_metacourse($course) {
// Make the assignments.
foreach ($assignments as $assignment) {
- $success = role_assign($assignment->roleid, $assignment->userid, 0, $context->id) && $success;
+ $success = role_assign($assignment->roleid, $assignment->userid, 0, $context->id, 0, 0, $assignment->hidden) && $success;
}
return $success;

0 comments on commit 47e32d2

Please sign in to comment.