diff options
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r-- | src/fields/util.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts index f0ff2dad4..6c92aef81 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -116,6 +116,13 @@ export function OVERRIDE_acl(val: boolean) { _overrideAcl = val; } +export function normalizeEmail(email: string) { + return email.replace('.', '__'); +} +export function denormalizeEmail(email: string) { + return email.replace('__', '.'); +} + // playground mode allows the user to add/delete documents or make layout changes without them saving to the server // let playgroundMode = false; @@ -184,7 +191,7 @@ 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. - const entity = key.substring(4).replace('_', '.'); // an individual or a group + const entity = denormalizeEmail(key.substring(4)); // an individual or a group if (currentUserGroups.includes(entity) || userChecked === entity) { if (HierarchyMapping.get(value as symbol)! > HierarchyMapping.get(effectiveAcl)!) { effectiveAcl = value as symbol; |