diff options
author | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-07-24 19:15:52 +0530 |
---|---|---|
committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-07-24 19:15:52 +0530 |
commit | 150d1b3ea263dd0d6d8189d8bf6fd87c5505cfc4 (patch) | |
tree | 9fe336f38dfd60c5a2324ed01700581247595da5 /src/fields/util.ts | |
parent | 2f49497e9d74eda97b2327ca4dbcb0a11ac6c6c9 (diff) |
fixed instances of AclEdit to include AclAdmin
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r-- | src/fields/util.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts index eba398dfb..a8b284658 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -67,11 +67,14 @@ const _setterImpl = action(function (target: any, prop: string | symbol | number delete curValue[Parent]; delete curValue[OnUpdate]; } + + const effectiveAcl = GetEffectiveAcl(target); + const writeMode = DocServer.getFieldWriteMode(prop as string); const fromServer = target[UpdatingFromServer]; const sameAuthor = fromServer || (receiver.author === Doc.CurrentUserEmail); - const writeToDoc = sameAuthor || GetEffectiveAcl(target) === AclEdit || (writeMode !== DocServer.WriteMode.LiveReadonly); - const writeToServer = (sameAuthor || GetEffectiveAcl(target) === AclEdit || writeMode === DocServer.WriteMode.Default) && !playgroundMode; + const writeToDoc = sameAuthor || effectiveAcl === AclEdit || effectiveAcl === AclAdmin || (writeMode !== DocServer.WriteMode.LiveReadonly); + const writeToServer = (sameAuthor || effectiveAcl === AclEdit || effectiveAcl === AclAdmin || writeMode === DocServer.WriteMode.Default) && !playgroundMode; if (writeToDoc) { if (value === undefined) { |