$statement->execute($conditionBuilder->getParameters());
$groupIDs = $statement->fetchMap('userID', 'groupID', false);
+ $ownerGroupID = UserGroup::getOwnerGroupID();
+
$users = [];
foreach ($userList as $user) {
- if (empty($groupIDs[$user->userID]) || UserGroup::isAccessibleGroup($groupIDs[$user->userID])) {
+ if (empty($groupIDs[$user->userID])) {
+ $users[$user->userID] = $user;
+ }
+ else if ($ownerGroupID && in_array($ownerGroupID, $groupIDs[$user->userID])) {
+ // Bulk actions can never affect members of the owner group.
+ continue;
+ }
+ else if (UserGroup::isAccessibleGroup($groupIDs[$user->userID])) {
$users[$user->userID] = $user;
}
}
public function __construct(DatabaseObject $object) {
parent::__construct($object);
- $this->availableUserGroups = UserGroup::getAccessibleGroups([], [UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS]);
+ $this->availableUserGroups = UserGroup::getAccessibleGroups([], [UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::OWNER, UserGroup::USERS]);
uasort($this->availableUserGroups, function(UserGroup $groupA, UserGroup $groupB) {
return strcmp($groupA->getName(), $groupB->getName());