MDL-73620 mod_forum: Fix issue with discussion permission check

Users with access to some groups but not all would receive an error
page when creating a discussion topic that was set to send to all
groups
This commit is contained in:
Alex Morris 2022-01-19 15:20:40 +13:00 committed by Alex Morris
parent cc4fec275f
commit 43fd7457e3
No known key found for this signature in database
GPG Key ID: 0501031386C92557

View File

@ -992,7 +992,7 @@ if ($mformpost->is_cancelled()) {
forum_check_blocking_threshold($thresholdwarning);
foreach ($groupstopostto as $group) {
if (!$capabilitymanager->can_create_discussions($USER, $groupid)) {
if (!$capabilitymanager->can_create_discussions($USER, $group)) {
throw new \moodle_exception('cannotcreatediscussion', 'forum');
}