Skip to content

Commit

Permalink
MDL-48274 mod_forum: Add missing context to has_capability call
Browse files Browse the repository at this point in the history
  • Loading branch information
mwehr authored and andrewnicols committed Nov 19, 2014
1 parent a74d474 commit 772e9dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mod/forum/subscribe.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
$issubscribed = \mod_forum\subscriptions::is_subscribed($user->id, $forum, $discussionid, $cm);

// For a user to subscribe when a groupmode is set, they must have access to at least one group.
if ($groupmode && !$issubscribed && !has_capability('moodle/site:accessallgroups')) {
if ($groupmode && !$issubscribed && !has_capability('moodle/site:accessallgroups', $context)) {
if (!groups_get_all_groups($course->id, $USER->id)) {
print_error('cannotsubscribe', 'forum');
}
Expand Down

0 comments on commit 772e9dc

Please sign in to comment.