Skip to content

Commit 4211c60

Browse files
authored
Merge pull request #9003 from jdarwood007/3.0/fixes8994
[3.0] Fix PM logic for groups
2 parents 7dab9df + d773510 commit 4211c60

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Sources/PersonalMessage/PM.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,15 @@ public static function send(array $recipients, string $subject, string $message,
12951295
}
12961296

12971297
// Load the groups that are allowed to read PMs.
1298-
$pmReadGroups = Group::getAllowedTo('pm_read');
1298+
$allGroups = Group::getAllWithPermissions('pm_read', null);
1299+
1300+
foreach ($allGroups as $k => $g) {
1301+
if ($g['pm_read'] === 1) {
1302+
$pmReadGroups['allowed'][] = $k;
1303+
} else {
1304+
$pmReadGroups['denied'][] = $k;
1305+
}
1306+
}
12991307

13001308
if (empty(Config::$modSettings['permission_enable_deny'])) {
13011309
$pmReadGroups['denied'] = [];

0 commit comments

Comments
 (0)