diff options
author | bobzel <zzzman@gmail.com> | 2020-08-30 14:48:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-30 14:48:28 -0400 |
commit | 754ef899758226dc0dbdec0c63d00db7ea9eca47 (patch) | |
tree | 65343289a95280c44520986d2983fdde74990385 /src/fields/util.ts | |
parent | 5683a5f344dd1c91a339c38061b3788701af0eb8 (diff) | |
parent | 0bdcfdb9b8e0fdfe48b58f1d2645325011d668d5 (diff) |
Merge pull request #648 from browngraphicslab/acls_uv
Sharing multiple selected documents
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r-- | src/fields/util.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts index 9679527e4..d0c722ddc 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -166,7 +166,7 @@ export function GetEffectiveAcl(target: any, in_prop?: string | symbol | number, if (target[AclSym] && Object.keys(target[AclSym]).length) { - if (currentUserGroups.includes("admin")) return AclAdmin; + if (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; @@ -183,7 +183,8 @@ export function GetEffectiveAcl(target: any, in_prop?: string | symbol | number, for (const [key, value] of Object.entries(target[AclSym])) { // there are issues with storing fields with . in the name, so they are replaced with _ during creation // as a result we need to restore them again during this comparison. - if (currentUserGroups.includes(key.substring(4).replace("_", ".")) || userChecked === key.substring(4).replace("_", ".")) { + const entity = key.substring(4).replace('_', '.'); // an individual or a group + if (currentUserGroups.includes(entity) || userChecked === entity) { if (HierarchyMapping.get(value as symbol)! > HierarchyMapping.get(effectiveAcl)!) { effectiveAcl = value as symbol; if (effectiveAcl === AclAdmin) break; |