diff options
author | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-08-12 18:03:59 -0500 |
---|---|---|
committer | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-08-12 18:03:59 -0500 |
commit | 284da73b9de8d51fa7c43739c338677b5ee9ba87 (patch) | |
tree | 46d9be5e96142d7b95c4310e4d60baf7d0bdabca /src/fields/util.ts | |
parent | 7a4a42dae14e0da1a026c2717c5183fa96a9e990 (diff) | |
parent | bb74db76c4cf694c646a3f248fa8151f15d8020e (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into menu_restructure
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r-- | src/fields/util.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts index 4edaea264..3d832636f 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -161,7 +161,6 @@ 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) || 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) @@ -218,9 +217,10 @@ export function distributeAcls(key: string, acl: SharingPermissions, target: Doc changed = true; // maps over the aliases of the document - if (target.aliases) { - DocListCast(target.aliases).map(alias => { - distributeAcls(key, acl, alias, inheritingFromCollection); + const aliases = DocListCast(target.aliases); + if (aliases.length) { + aliases.map(alias => { + alias !== target && distributeAcls(key, acl, alias, inheritingFromCollection); }); } |