From 9eb563e6d1765e9cb7fa674399bbc2695f93336e Mon Sep 17 00:00:00 2001 From: srichman333 Date: Wed, 21 Jun 2023 13:22:31 -0400 Subject: start of augment -> self-edit --- .../views/nodes/formattedText/ProsemirrorExampleTransfer.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts b/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts index ecd0bf8aa..ec56c043b 100644 --- a/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts +++ b/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts @@ -12,6 +12,7 @@ import { RTFMarkup } from '../../../util/RTFMarkup'; import { SelectionManager } from '../../../util/SelectionManager'; import { OpenWhere } from '../DocumentView'; import { liftListItem, sinkListItem } from './prosemirrorPatches.js'; +import { Doc } from '../../../../fields/Doc'; const mac = typeof navigator !== 'undefined' ? /Mac/.test(navigator.platform) : false; @@ -48,7 +49,16 @@ export function buildKeymap>(schema: S, props: any, mapKey const canEdit = (state: any) => { switch (GetEffectiveAcl(props.DataDoc)) { case AclAugment: - return false; + const content = state.selection.$anchor.path[0].content.content; + var line = content[content.length-1].content.content; + var lastEdit = line[line.length-1]; + if (line == undefined || line.length == 0){ + lastEdit = content[content.length-1]; + } + const lastEditor = lastEdit.marks[lastEdit.marks.length-1].attrs.userid + if (lastEditor != Doc.CurrentUserEmail){ + return false; + } } return true; }; -- cgit v1.2.3-70-g09d2