You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// get the node again from the owner's storage to avoid sharing permission issues
545
544
$ownerId = $node->getOwner()->getUID();
@@ -558,8 +557,8 @@ private function shareWithApprovers(int $fileId, array $rule, string $userId): a
558
557
foreach ($rule['approvers'] as$approver) {
559
558
if ($approver['type'] === 'user' && !in_array($approver['entityId'], $userIdsWithAccess, true)) {
560
559
// create user share
561
-
if ($this->utilsService->createShare($node, IShare::TYPE_USER, $approver['entityId'], $fileOwner, $label)) {
562
-
$createdShares[] = $approver;
560
+
if (!$this->utilsService->createShare($node, IShare::TYPE_USER, $approver['entityId'], $fileOwner, $label)) {
561
+
$this->logger->warning('Failed to create user share for file {fileId} with approver {approverId}', ['fileId' => $fileId, 'approverId' => $approver['entityId']]);
563
562
}
564
563
}
565
564
}
@@ -571,20 +570,16 @@ private function shareWithApprovers(int $fileId, array $rule, string $userId): a
// Create group share if everyone in the group needs access
573
572
if (count($groupMembersThatNeedAccess) === count($groupMemberIds)) {
574
-
if ($this->utilsService->createShare($node, IShare::TYPE_GROUP, $approver['entityId'], $fileOwner, $label)) {
575
-
$createdShares[] = $approver;
573
+
if (!$this->utilsService->createShare($node, IShare::TYPE_GROUP, $approver['entityId'], $fileOwner, $label)) {
574
+
$this->logger->warning('Failed to create group share for file {fileId} with approver {approverId}', ['fileId' => $fileId, 'approverId' => $approver['entityId']]);
if (!$this->utilsService->createShare($node, IShare::TYPE_USER, $groupMemberId, $fileOwner, $label)) {
582
-
$success = false;
580
+
$this->logger->warning('Failed to create user share for file {fileId} with approver {approverId}', ['fileId' => $fileId, 'approverId' => $groupMemberId]);
583
581
}
584
582
}
585
-
if ($success) {
586
-
$createdShares[] = $approver;
587
-
}
588
583
}
589
584
}
590
585
}
@@ -594,14 +589,12 @@ private function shareWithApprovers(int $fileId, array $rule, string $userId): a
594
589
if ($circlesEnabled) {
595
590
foreach ($rule['approvers'] as$approver) {
596
591
if ($approver['type'] === 'circle') {
597
-
if ($this->utilsService->createShare($node, IShare::TYPE_CIRCLE, $approver['entityId'], $fileOwner, $label)) {
598
-
$createdShares[] = $approver;
592
+
if (!$this->utilsService->createShare($node, IShare::TYPE_CIRCLE, $approver['entityId'], $fileOwner, $label)) {
593
+
$this->logger->warning('Failed to create circle share for file {fileId} with approver {approverId}', ['fileId' => $fileId, 'approverId' => $approver['entityId']]);
0 commit comments