diff options
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index c9aaa5158..9083d6ca3 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -156,9 +156,9 @@ export const ReverseHierarchyMap: Map<string, { level: aclLevel; acl: symbol; im export function updateCachedAcls(doc: Doc) { if (doc) { const target = (doc as any)?.__fieldTuples ?? doc; - const permissions: { [key: string]: symbol } = !target.author || target.author === ClientUtils.CurrentUserEmail() ? { 'acl-Me': AclAdmin } : {}; + const permissions: { [key: string]: symbol } = !target.author || target.author === ClientUtils.CurrentUserEmail() ? { acl_Me: AclAdmin } : {}; Object.keys(target).forEach(key => { - key.startsWith('acl') && (permissions[key] = ReverseHierarchyMap.get(StrCast(target[key]))!.acl); + key.startsWith('acl_') && (permissions[key] = ReverseHierarchyMap.get(StrCast(target[key]))!.acl); }); if (Object.keys(permissions).length || doc[DocAcl]?.length) { runInAction(() => { @@ -382,7 +382,7 @@ export class Doc extends RefField { this[UpdatingFromServer] = true; this[fKey] = value; this[UpdatingFromServer] = false; - if (fKey.startsWith('acl')) { + if (fKey.startsWith('acl_')) { updateCachedAcls(this); } if (prev === AclPrivate && GetEffectiveAcl(this) !== AclPrivate) { @@ -390,7 +390,7 @@ export class Doc extends RefField { } }; const writeMode = DocServer.getFieldWriteMode(fKey); - if (fKey.startsWith('acl') || writeMode !== DocServer.WriteMode.Playground) { + if (fKey.startsWith('acl_') || writeMode !== DocServer.WriteMode.Playground) { delete this[CachedUpdates][fKey]; // eslint-disable-next-line no-await-in-loop await fn(); @@ -832,7 +832,7 @@ export namespace Doc { newLayoutDoc.rootDocument = targetDoc; newLayoutDoc.embedContainer = targetDoc; newLayoutDoc.resolvedDataDoc = dataDoc; - newLayoutDoc['acl-Guest'] = SharingPermissions.Edit; + newLayoutDoc.acl_Guest = SharingPermissions.Edit; if (dataDoc[templateField] === undefined && (templateLayoutDoc[templateField] as any)?.length) { dataDoc[templateField] = ObjectField.MakeCopy(templateLayoutDoc[templateField] as List<Doc>); // ComputedField.MakeFunction(`ObjectField.MakeCopy(templateLayoutDoc["${templateField}"])`, { templateLayoutDoc: Doc.name }, { templateLayoutDoc }); @@ -970,7 +970,7 @@ export namespace Doc { delegate.proto = doc; delegate.author = ClientUtils.CurrentUserEmail(); Object.keys(doc) - .filter(key => key.startsWith('acl')) + .filter(key => key.startsWith('acl_')) .forEach(key => { delegate[key] = doc[key]; }); |