From e31f6403bc62faea72767f68d3bf34ac8bd28183 Mon Sep 17 00:00:00 2001
From: srichman333 <sarah_n_richman@brown.edu>
Date: Thu, 15 Jun 2023 12:43:58 -0400
Subject: acls distribute properly, documentDecorations shows user effective
 acl

---
 src/client/util/SharingManager.tsx | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

(limited to 'src/client/util/SharingManager.tsx')

diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx
index 78e502e6e..01f36bd29 100644
--- a/src/client/util/SharingManager.tsx
+++ b/src/client/util/SharingManager.tsx
@@ -159,13 +159,14 @@ export class SharingManager extends React.Component<{}> {
         const myAcl = `acl-${Doc.CurrentUserEmailNormalized}`;
         const isDashboard = DocListCast(Doc.MyDashboards.data).indexOf(target) !== -1;
 
-        // setting the same acl for a docs within the doc being shared
-        if (this.overridePrivate) {
-            var childDocs = DocListCast(target.data);
-            childDocs.map(doc => {
+        // setting the same acl for a docs within the doc being shared if they haven't been set yet
+        // or if the 'Override Private' checkbox is selected
+        var childDocs = DocListCast(target.data);
+        childDocs.map(doc => {
+            if (this.overridePrivate || doc[acl]==undefined){
                 this.setInternalSharing(recipient, permission, doc);
-            });
-        }
+            }
+        });
 
         const docs = SelectionManager.Views().length < 2 ? [target] : SelectionManager.Views().map(docView => docView.props.Document);
 
-- 
cgit v1.2.3-70-g09d2

