Skip to content

Commit e6c1462

Browse files
committed
fix role audience filter
1 parent 3254ba0 commit e6c1462

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

classes/audience.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,10 @@ public static function meets_roles_requirements($notificationid, $userid, $block
148148
JOIN {context} ctx
149149
ON ctx.id = ra.contextid
150150
WHERE ' . $DB->sql_like('ctx.path', ':ctxpath', false) . '
151-
AND roleid ' . $rolessql;
151+
AND roleid ' . $rolessql . '
152+
AND userid = :userid';
152153
$params['ctxpath'] = $context->path . '%';
154+
$params['userid'] = $userid;
153155

154156
return $DB->record_exists_sql($sql, $params);
155157
}

0 commit comments

Comments
 (0)