diff options
author | bobzel <zzzman@gmail.com> | 2020-08-25 14:42:15 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-08-25 14:42:15 -0400 |
commit | 57458679ffe87302b46c64ffaa05f967c84623df (patch) | |
tree | 306c9d0134a4d6486d98f5697ac51dfa5ff45e24 /src/fields/util.ts | |
parent | 0c01e7e4a4b32336268da2ff63972cb3806b49a1 (diff) |
major rewrite of schema table and schem cells. lists/docs work now. dates display better. resizing is better and faster (but not fast).
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r-- | src/fields/util.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts index d8523dfa2..9679527e4 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -156,14 +156,17 @@ export enum SharingPermissions { */ export function GetEffectiveAcl(target: any, in_prop?: string | symbol | number, user?: string): symbol { if (!target) return AclPrivate; + + // all changes received fromt the server must be processed as Admin if (in_prop === UpdatingFromServer || target[UpdatingFromServer]) return AclAdmin; - 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 + const userChecked = user || Doc.CurrentUserEmail; + if (userChecked === (target.__fields?.author || target.author)) return AclAdmin; - const userChecked = user || Doc.CurrentUserEmail; + 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 - if (userChecked === (target.__fields?.author || target.author) || 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; |