From 5141fa9dc00437bd9fade47509f421bd8b63feee Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 11 Jul 2023 20:04:26 -0400 Subject: fixed sharing of presentations with dashboards. --- src/fields/util.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/fields/util.ts b/src/fields/util.ts index e89cb1fb1..4ce9a4128 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -15,7 +15,7 @@ import { RefField } from './RefField'; import { RichTextField } from './RichTextField'; import { SchemaHeaderField } from './SchemaHeaderField'; import { ComputedField } from './ScriptField'; -import { ScriptCast, StrCast } from './Types'; +import { DocCast, ScriptCast, StrCast } from './Types'; function _readOnlySetter(): never { throw new Error("Documents can't be modified in read-only mode"); @@ -259,6 +259,12 @@ export function distributeAcls(key: string, acl: SharingPermissions, target: Doc d !== d[DocData] && distributeAcls(key, acl, d[DocData], visited, allowUpgrade ? true : false); }); + Object.keys(target) // share expanded layout templates (eg, for presElementBox'es ) + .filter(lkey => lkey.includes('layout[') && DocCast(target[lkey])) + .map(lkey => { + distributeAcls(key, acl, DocCast(target[lkey]), visited, allowUpgrade ? true : false); + }); + if (GetEffectiveAcl(dataDoc) === AclAdmin) { dataDoc[key] = acl; dataDocChanged = true; -- cgit v1.2.3-70-g09d2