From c3b15a00bd0fd80f6399004de846d6ba86cdd44d Mon Sep 17 00:00:00 2001 From: Abin Simon Date: Fri, 22 Dec 2023 11:43:28 +0530 Subject: [PATCH] Note about anonymous link shares (#4905) --- #### Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [ ] :no_entry: No #### Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Supportability/Tests - [ ] :computer: CI/Deployment - [ ] :broom: Tech Debt/Cleanup #### Issue(s) * # #### Test Plan - [ ] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- src/internal/m365/collection/drive/metadata/permissions.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/internal/m365/collection/drive/metadata/permissions.go b/src/internal/m365/collection/drive/metadata/permissions.go index e4d781c04..f7ec29b6c 100644 --- a/src/internal/m365/collection/drive/metadata/permissions.go +++ b/src/internal/m365/collection/drive/metadata/permissions.go @@ -79,6 +79,11 @@ func DiffLinkShares(current, expected []LinkShare) ([]LinkShare, []LinkShare) { filteredExpected := []LinkShare{} for _, ls := range current { + // It is useless to restore link shares without associated + // entities. When we do a link share restore, it always creates + // a new link(we cannot reuse the old link). Since we + // have no way of knowing the users who previously had access to + // an item via link, we don't have a reason to restore the link. if len(ls.Entities) == 0 { continue }