Skip to content

Commit

Permalink
fix(updateAccessDeclarative): Make sure userIDs is a list (#87)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr authored Dec 19, 2024
1 parent 1f955dd commit febfbcb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Listener/FileListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function handle(Event $event): void {
$shareUserIds = array_keys($shareAccessList['users']);
$fileUserIds = $this->storageService->getUsersForFileId($file->getId());

$userIds = array_unique(array_merge($shareUserIds, $fileUserIds));
$userIds = array_values(array_unique(array_merge($shareUserIds, $fileUserIds)));
$fileRef = ProviderConfigService::getSourceId($file->getId());
$this->actionService->updateAccessDeclSource($userIds, $fileRef);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Listener/ShareListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function handle(Event $event): void {
// who have really lost access to the file and are present in $fileUserIds list
$realFileUserIds = array_diff($fileUserIds, $reallyUnsharedWith);
// merge the share and file lists to get the final list of user(s) who have access to the file
$userIds = array_unique(array_merge($realFileUserIds, $shareUserIds));
$userIds = array_values(array_unique(array_merge($realFileUserIds, $shareUserIds)));

if ($node instanceof Folder) {
$files = $this->storageService->getAllFilesInFolder($node);
Expand Down

0 comments on commit febfbcb

Please sign in to comment.