diff options
author | bobzel <zzzman@gmail.com> | 2023-07-11 20:04:26 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-07-11 20:04:26 -0400 |
commit | 5141fa9dc00437bd9fade47509f421bd8b63feee (patch) | |
tree | c0ee231c5bf9af4b9af391704ffe0ef5e7479501 | |
parent | b54443ecb79345ce0be802bd53d9f60ae996b55d (diff) |
fixed sharing of presentations with dashboards.
-rw-r--r-- | src/fields/util.ts | 8 |
1 files changed, 7 insertions, 1 deletions
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; |