From 4ae57d4a8536e33a2fa617fb2b5a24f79a8e61f6 Mon Sep 17 00:00:00 2001 From: rivexe Date: Fri, 29 Mar 2024 13:48:39 +0300 Subject: [PATCH] fix: if the user has no groups, then he is not a member of excluded groups --- controller/editorcontroller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index ef6efae2..11c54dd7 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -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; } @@ -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; }