aboutsummaryrefslogtreecommitdiff
path: root/src/fields/util.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r--src/fields/util.ts28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts
index fc0057827..17eb47222 100644
--- a/src/fields/util.ts
+++ b/src/fields/util.ts
@@ -287,15 +287,16 @@ export function distributeAcls(key: string, acl: SharingPermissions, target: Doc
let layoutDocChanged = false; // determines whether fetchProto should be called or not (i.e. is there a change that should be reflected in target[AclSym])
// if it is inheriting from a collection, it only inherits if A) the key doesn't already exist or B) the right being inherited is more restrictive
- if (GetEffectiveAcl(target) === AclAdmin && (!inheritingFromCollection || !target[key] || ReverseHierarchyMap.get(StrCast(target[key]))!.level > ReverseHierarchyMap.get(acl)!.level)) {
- target[key] = acl;
- layoutDocChanged = true;
- if (isDashboard) {
- DocListCastAsync(target[Doc.LayoutFieldKey(target)]).then(docs => {
- docs?.forEach(d => distributeAcls(key, acl, d, inheritingFromCollection, visited));
- });
- }
- }
+ // taken care of in SharingManager now so that users can decide if they want nested docs changed
+ // if (GetEffectiveAcl(target) === AclAdmin && (!inheritingFromCollection || !target[key] || ReverseHierarchyMap.get(StrCast(target[key]))!.level > ReverseHierarchyMap.get(acl)!.level)) {
+ // target[key] = acl;
+ // layoutDocChanged = true;
+ // if (isDashboard) {
+ // DocListCastAsync(target[Doc.LayoutFieldKey(target)]).then(docs => {
+ // docs?.forEach(d => distributeAcls(key, acl, d, inheritingFromCollection, visited));
+ // });
+ // }
+ // }
let dataDocChanged = false;
const dataDoc = target[DocData];
@@ -309,10 +310,11 @@ export function distributeAcls(key: string, acl: SharingPermissions, target: Doc
LinkManager.Links(dataDoc).forEach(link => distributeAcls(key, acl, link, inheritingFromCollection, visited));
// maps over the children of the document
- DocListCast(dataDoc[Doc.LayoutFieldKey(dataDoc)]).forEach(d => {
- distributeAcls(key, acl, d, inheritingFromCollection, visited);
- distributeAcls(key, acl, d[DocData], inheritingFromCollection, visited);
- });
+ // taken care of in SharingManager now so that users can decide if they want nested docs changed
+ // DocListCast(dataDoc[Doc.LayoutFieldKey(dataDoc)]).forEach(d => {
+ // distributeAcls(key, acl, d, inheritingFromCollection, visited);
+ // distributeAcls(key, acl, d[DocData], inheritingFromCollection, visited);
+ // });
// maps over the annotations of the document
DocListCast(dataDoc[Doc.LayoutFieldKey(dataDoc) + '_annotations']).forEach(d => {