diff --git a/src/frontend/apps/impress/src/features/pads/pad/components/BlockNoteEditor.tsx b/src/frontend/apps/impress/src/features/pads/pad/components/BlockNoteEditor.tsx
index c628e285..4ee4a5d1 100644
--- a/src/frontend/apps/impress/src/features/pads/pad/components/BlockNoteEditor.tsx
+++ b/src/frontend/apps/impress/src/features/pads/pad/components/BlockNoteEditor.tsx
@@ -1,5 +1,6 @@
import { BlockNoteView, useCreateBlockNote } from '@blocknote/react';
import '@blocknote/react/style.css';
+import { Alert, VariantType } from '@openfun/cunningham-react';
import React, { useEffect, useState } from 'react';
import { WebrtcProvider } from 'y-webrtc';
@@ -57,6 +58,8 @@ export const BlockNoteContent = ({ pad, provider }: BlockNoteContentProps) => {
},
});
+ editor.isEditable = pad.abilities.partial_update;
+
useEffect(() => {
setEditor(pad.id, editor);
}, [setEditor, pad.id, editor]);
@@ -69,6 +72,13 @@ export const BlockNoteContent = ({ pad, provider }: BlockNoteContentProps) => {
};
`}
>
+ {!pad.abilities.partial_update && (
+
+ {`Read only, you don't have the right to update this pad.`}
+
+ )}
diff --git a/src/frontend/apps/impress/src/features/pads/pad/types.tsx b/src/frontend/apps/impress/src/features/pads/pad/types.tsx
index 97343beb..50fe75ea 100644
--- a/src/frontend/apps/impress/src/features/pads/pad/types.tsx
+++ b/src/frontend/apps/impress/src/features/pads/pad/types.tsx
@@ -28,5 +28,6 @@ export interface Pad {
retrieve: boolean;
manage_accesses: boolean;
update: boolean;
+ partial_update: boolean;
};
}
diff --git a/src/frontend/apps/impress/src/features/templates/template/components/TemplateEditor.tsx b/src/frontend/apps/impress/src/features/templates/template/components/TemplateEditor.tsx
index f62502c2..9863d6c3 100644
--- a/src/frontend/apps/impress/src/features/templates/template/components/TemplateEditor.tsx
+++ b/src/frontend/apps/impress/src/features/templates/template/components/TemplateEditor.tsx
@@ -52,7 +52,7 @@ export const TemplateEditor = ({ template }: TemplateEditorProps) => {
? template.code_editor
: editor.getProjectData();
- editor.loadProjectData(projectData);
+ editor?.loadProjectData(projectData);
editor.Storage.add('remote', {
load() {
@@ -118,6 +118,14 @@ export const TemplateEditor = ({ template }: TemplateEditorProps) => {
)}
+ {!template.abilities.partial_update && (
+
+ {`Read only, you don't have the right to update this template.`}
+
+ )}
+