aboutsummaryrefslogtreecommitdiff
path: root/src/fields
diff options
context:
space:
mode:
authoranika-ahluwalia <anika.ahluwalia@gmail.com>2020-08-12 11:26:33 -0500
committeranika-ahluwalia <anika.ahluwalia@gmail.com>2020-08-12 11:26:33 -0500
commiteeb231fd66d93d29a7babca9b92d08e4e64ff84b (patch)
treeb1843e276f0fe8ba6ec14ba9c8317695d6f49115 /src/fields
parentcc343493b9da86e188c7e9a932033e1a080155cc (diff)
parente976cf57176b5ba8d758ccfd63d443c291781b4f (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into menu_restructure
Diffstat (limited to 'src/fields')
-rw-r--r--src/fields/Doc.ts3
-rw-r--r--src/fields/util.ts2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index b535fea5a..00ffe399e 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -806,7 +806,8 @@ export namespace Doc {
target[targetKey] = new PrefetchProxy(templateDoc);
} else {
titleTarget && (Doc.GetProto(target).title = titleTarget);
- Doc.GetProto(target)[targetKey] = new PrefetchProxy(templateDoc);
+ const setDoc = [AclAdmin, AclEdit].includes(GetEffectiveAcl(Doc.GetProto(target))) ? Doc.GetProto(target) : target;
+ setDoc[targetKey] = new PrefetchProxy(templateDoc);
}
}
return target;
diff --git a/src/fields/util.ts b/src/fields/util.ts
index 4c71572db..4edaea264 100644
--- a/src/fields/util.ts
+++ b/src/fields/util.ts
@@ -162,7 +162,7 @@ export function GetEffectiveAcl(target: any, in_prop?: string | symbol | number)
// 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;