diff options
author | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-08-12 21:47:39 +0530 |
---|---|---|
committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-08-12 21:47:39 +0530 |
commit | c01cb1dcda454a80555d2ae041800ef3bd261d81 (patch) | |
tree | 48a2e6eacd31f0c1562a75bc6aa2f1b54f7b1c4e /src/fields/util.ts | |
parent | 12f3a34f253c2d70ead3fa9d7260df2d8cd0c2cd (diff) |
used datadoc for acl calculations in many places + some other changes
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r-- | src/fields/util.ts | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts index 7d3268b80..3d832636f 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -161,15 +161,11 @@ export function GetEffectiveAcl(target: any, in_prop?: string | symbol | number) if (target[AclSym] && Object.keys(target[AclSym]).length) { // if the current user is the author of the document / the current user is a member of the admin group - // but not if the doc in question is an alias - the current user will be the author of their alias rather than the original author - if ((Doc.CurrentUserEmail === (target.__fields?.author || target.author) && !(target.aliasOf || target.__fields?.aliasOf)) || currentUserGroups.includes("admin")) return AclAdmin; + if (Doc.CurrentUserEmail === (target.__fields?.author || target.author) || currentUserGroups.includes("admin")) return AclAdmin; // if the ACL is being overriden or the property being modified is one of the playground fields (which can be freely modified) if (_overrideAcl || (in_prop && DocServer.PlaygroundFields?.includes(in_prop.toString()))) return AclEdit; - // if it's your alias then you can manipulate the x, y, width, height - if ((target.aliasOf || target.__fields?.aliasOf) && Doc.CurrentUserEmail === (target.__fields?.author || target.author) && (in_prop && ["_width", "_height", "x", "y"].includes(in_prop.toString()))) return AclEdit; - let effectiveAcl = AclPrivate; const HierarchyMapping = new Map<symbol, number>([ [AclPrivate, 0], |