diff options
author | brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> | 2022-10-28 10:10:04 -0400 |
---|---|---|
committer | brynnchernosky <56202540+brynnchernosky@users.noreply.github.com> | 2022-10-28 10:10:04 -0400 |
commit | ceb338752aacc383c97a0e3a9b608365a1cf39b6 (patch) | |
tree | d2f355b726a9b21950f332c0f65931d7d6eef515 /src/fields/util.ts | |
parent | 5d6a0458b9d4f35e0c568a4d76d4fcab4e22f698 (diff) | |
parent | 2fc88a931cb2fc3408297b000208990633445585 (diff) |
merge
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r-- | src/fields/util.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts index b3cbbe241..4a62a6a1f 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -1,8 +1,10 @@ import { action, observable, runInAction, trace } from 'mobx'; import { computedFn } from 'mobx-utils'; import { DocServer } from '../client/DocServer'; +import { CollectionViewType } from '../client/documents/DocumentTypes'; import { SerializationHelper } from '../client/util/SerializationHelper'; import { UndoManager } from '../client/util/UndoManager'; +import { CollectionDockingView } from '../client/views/collections/CollectionDockingView'; import { returnZero } from '../Utils'; import CursorField from './CursorField'; import { @@ -278,6 +280,15 @@ function getEffectiveAcl(target: any, user?: string): symbol { export function distributeAcls(key: string, acl: SharingPermissions, target: Doc, inheritingFromCollection?: boolean, visited?: Doc[], isDashboard?: boolean) { if (!visited) visited = [] as Doc[]; if (visited.includes(target)) return; + + if ((target._viewType === CollectionViewType.Docking && visited.length > 1) || Doc.GetProto(visited[0]) !== Doc.GetProto(target)) { + target[key] = acl; + if (target !== Doc.GetProto(target)) { + //apparently we can't call updateCachedAcls twice (once for the main dashboard, and again for the nested dashboard...???) + updateCachedAcls(target); + } + return; + } visited.push(target); const HierarchyMapping = new Map<string, number>([ |