diff options
author | bobzel <zzzman@gmail.com> | 2023-07-05 16:15:27 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-07-05 16:15:27 -0400 |
commit | 5a9af979cc293d0e3843270ee053c24bf0eb6ef5 (patch) | |
tree | 1c03d5fb55a97f5e3da96a448af5079ec2b0e42b /src/fields/Doc.ts | |
parent | bf609fdadc164da5663671a0c42c3a13056ee376 (diff) |
changed acl inheritance for docking views.
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index 99712fb04..9c138d348 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -20,7 +20,6 @@ import { AclEdit, AclPrivate, AclReadonly, - AclSelfEdit, AclUnset, Animation, CachedUpdates, @@ -138,7 +137,7 @@ export const HierarchyMapping: Map<symbol, { level:aclLevel; name: SharingPermis [AclAdmin, { level: aclLevel.admin, name: SharingPermissions.Admin, image: '⬢' }], [AclUnset, { level: aclLevel.unset, name: SharingPermissions.Unset, image: '▲' }], ]); -export const ReverseHierarchyMap: Map<string, { level: aclLevel; acl: symbol ; image: string}> = new Map(Array.from(HierarchyMapping.entries()).map(value => [value[1].name, { level: value[1].level, acl: value[0], image: value[1].image }])); +export const ReverseHierarchyMap: Map<string, { level: aclLevel; acl: symbol; image: string }> = new Map(Array.from(HierarchyMapping.entries()).map(value => [value[1].name, { level: value[1].level, acl: value[0], image: value[1].image }])); // caches the document access permissions for the current user. // this recursively updates all protos as well. @@ -478,6 +477,14 @@ export namespace Doc { // }); // } + export function SetContainer(doc: Doc, container: Doc) { + doc.embedContainer = container; + if (Doc.GetProto(container).author === doc.author) { + Object.keys(Doc.GetProto(container)) + .filter(key => key.startsWith('acl')) + .forEach(key => (doc[key] = Doc.GetProto(container)[key])); + } + } export function RunCachedUpdate(doc: Doc, field: string) { const update = doc[CachedUpdates][field]; if (update) { |