diff options
author | bobzel <zzzman@gmail.com> | 2020-08-12 13:13:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-12 13:13:35 -0400 |
commit | c38249e8df315272783cf95439e62b4871a42502 (patch) | |
tree | d3f9b89b33d216c4ca5d9b522b93b7b2831a5520 /src/fields/util.ts | |
parent | e976cf57176b5ba8d758ccfd63d443c291781b4f (diff) | |
parent | 56ae02ffc13d69f6e79f327ea99d154f03e0fd34 (diff) |
Merge pull request #553 from browngraphicslab/acls_uv
A bunch of changes
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); }); } |