aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-06-21 13:22:31 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-06-21 13:22:31 -0400
commit9eb563e6d1765e9cb7fa674399bbc2695f93336e (patch)
tree3764e19036da7afa7433dcbdbaa473b7eea78d84 /src
parent899a6bdeb8ab0ce749328fc6093496daada1c4ad (diff)
start of augment -> self-edit
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts12
1 files changed, 11 insertions, 1 deletions
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<S extends Schema<any>>(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;
};