diff options
author | Lionel Han <47760119+IGoByJoe@users.noreply.github.com> | 2020-08-14 12:55:05 -0700 |
---|---|---|
committer | Lionel Han <47760119+IGoByJoe@users.noreply.github.com> | 2020-08-14 12:55:05 -0700 |
commit | 4fd8f1533be68bdcd3a6b8a832a38655adde4d71 (patch) | |
tree | cd2110b252c6a73932dfae36ba3d535d5e40fff0 /src/fields/util.ts | |
parent | a9161a668c96750d8bb50647c043a979058ef451 (diff) | |
parent | 36f7b54914b4d5fce98de3a6d83f1b186ebb17d1 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into new_audio
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r-- | src/fields/util.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts index 4c71572db..3d832636f 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -161,8 +161,7 @@ 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; @@ -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); }); } |