From 0007d043f7f27ce7d1103198ecb0e95e81362619 Mon Sep 17 00:00:00 2001 From: bobzel Date: Sat, 8 Jul 2023 09:19:16 -0400 Subject: fixed adding tabs to not try to distribute acls (this is done through adding a Doc to the docking view's Doc list). --- src/fields/util.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/fields') diff --git a/src/fields/util.ts b/src/fields/util.ts index 815f3b186..36f619120 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -240,7 +240,9 @@ export function distributeAcls(key: string, acl: SharingPermissions, target: Doc let dataDocChanged = false; const dataDoc = target[DocData]; - if (dataDoc && (allowUpgrade || !dataDoc[key] || ReverseHierarchyMap.get(StrCast(dataDoc[key]))! > ReverseHierarchyMap.get(acl)!)) { + const curVal = ReverseHierarchyMap.get(StrCast(dataDoc[key]))?.level ?? 0; + const aclVal = ReverseHierarchyMap.get(acl)?.level ?? 0; + if (dataDoc && (allowUpgrade || !dataDoc[key] || curVal > aclVal)) { // propagate ACLs to links, children, and annotations LinkManager.Links(dataDoc).forEach(link => distributeAcls(key, acl, link, visited, allowUpgrade)); -- cgit v1.2.3-70-g09d2