Skip to content

Commit

Permalink
Merge pull request #970 from ONLYOFFICE/hotfix/excluded-groups-member…
Browse files Browse the repository at this point in the history
…ship-in-users-list

fix: if the user has no groups, then he is not a member of excluded groups
  • Loading branch information
LinneyS authored Apr 1, 2024
2 parents 59e6f6a + 4ae57d4 commit 5e658ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controller/editorcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ public function users($fileId, $operationType = null) {

$excludedGroups = $this->getShareExcludedGroups();
$isMemberExcludedGroups = true;
if (count(array_intersect($currentUserGroups, $excludedGroups)) !== count($currentUserGroups)) {
if ((count(array_intersect($currentUserGroups, $excludedGroups)) !== count($currentUserGroups)) || empty($currentUserGroups)) {
$isMemberExcludedGroups = false;
}

Expand Down Expand Up @@ -519,7 +519,7 @@ public function mention($fileId, $anchor, $comment, $emails) {

$excludedGroups = $this->getShareExcludedGroups();
$isMemberExcludedGroups = true;
if (count(array_intersect($currentUserGroups, $excludedGroups)) !== count($currentUserGroups)) {
if ((count(array_intersect($currentUserGroups, $excludedGroups)) !== count($currentUserGroups)) || empty($currentUserGroups)) {
$isMemberExcludedGroups = false;
}

Expand Down

0 comments on commit 5e658ea

Please sign in to comment.