From 37089281d5283d685e39ce922d2fe89e4c78f0d4 Mon Sep 17 00:00:00 2001 From: usodhi <61431818+usodhi@users.noreply.github.com> Date: Thu, 24 Sep 2020 23:17:12 +0530 Subject: shifted override location in geteffectiveacl --- src/fields/util.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/fields/util.ts b/src/fields/util.ts index fa1c47055..c055be132 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -173,11 +173,6 @@ export function GetEffectiveAcl(target: any, in_prop?: string | symbol | number, // 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 there's an overriding acl set through the properties panel or sharing menu, that's what's returned. - // if it's unset, it just goes ahead - const override = target[AclSym]["acl-Override"]; - if (override !== AclUnset && override !== undefined) return target[AclSym]["acl-Override"]; - let effectiveAcl = AclPrivate; const HierarchyMapping = new Map([ [AclPrivate, 0], @@ -198,6 +193,12 @@ export function GetEffectiveAcl(target: any, in_prop?: string | symbol | number, } } } + + // if there's an overriding acl set through the properties panel or sharing menu, that's what's returned. + // if it's unset, it just goes ahead + const override = target[AclSym]["acl-Override"]; + if (override !== AclUnset && override !== undefined) effectiveAcl = target[AclSym]["acl-Override"]; + // if we're in playground mode, return AclEdit (or AclAdmin if that's the user's effectiveAcl) return DocServer?.Control?.isReadOnly?.() && HierarchyMapping.get(effectiveAcl)! < 3 ? AclEdit : effectiveAcl; } -- cgit v1.2.3-70-g09d2