Skip to content

Commit be5f62d

Browse files
committed
Issues-502: Group owner can add new users to archived groups
1 parent 097aee4 commit be5f62d

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

models/class.groupmodel.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,12 +1466,16 @@ public function canLeave($group) {
14661466
*
14671467
*/
14681468
public function canManageMembers($group) {
1469-
if((int)$group->Archived === 1) {
1469+
if(Gdn::session()->UserID == $group->OwnerID) {
1470+
return true;
1471+
}
1472+
1473+
if((int)$group->Archived == 1) {
14701474
return false;
14711475
}
1476+
14721477
$groupRole = self::getGroupRoleFor(Gdn::session()->UserID, $group->GroupID);
1473-
if($groupRole == GroupModel::ROLE_LEADER ||
1474-
Gdn::session()->UserID == $group->OwnerID) {
1478+
if($groupRole == GroupModel::ROLE_LEADER ) {
14751479
return true;
14761480
}
14771481
return false;
@@ -1486,12 +1490,15 @@ public function canInviteNewMember($group) {
14861490
$group = $this->getByGroupID($group);
14871491
}
14881492

1489-
if((int)$group->Archived === 1) {
1493+
if(Gdn::session()->UserID == $group->OwnerID) {
1494+
return true;
1495+
}
1496+
1497+
if((int)$group->Archived == 1) {
14901498
return false;
14911499
}
14921500
$groupRole = self::getGroupRoleFor(Gdn::session()->UserID, $group->GroupID);
14931501
if($groupRole === GroupModel::ROLE_LEADER ||
1494-
Gdn::session()->UserID === $group->OwnerID ||
14951502
Gdn::session()->checkPermission(GroupsPlugin::GROUPS_EMAIL_INVITATIONS_PERMISSION)) {
14961503
return true;
14971504
}

0 commit comments

Comments
 (0)