@@ -107,7 +107,7 @@ const OutlineNode = ({
107107 const { selectedContainerState, openContainerSidebar, setSelectedContainerState } = useOutlineSidebarContext ( ) ;
108108 const { courseId, openUnlinkModal, getUnitUrl } = useCourseAuthoringContext ( ) ;
109109 const duplicateMutation = useDuplicateItem ( courseId ) ;
110- const { openPublishModal } = useCourseOutlineContext ( ) ;
110+ const { openPublishModal, canEditCourseContent } = useCourseOutlineContext ( ) ;
111111 const queryClient = useQueryClient ( ) ;
112112 const { sharedClipboardData, showPasteUnit, copyToClipboard } = useClipboard ( ) ;
113113 const intl = useIntl ( ) ;
@@ -236,7 +236,7 @@ const OutlineNode = ({
236236 else { onOrderChange ( effectiveSection , getPossibleMoves ! ( index , 1 ) ) ; }
237237 } ;
238238
239- const isDraggable = model . isDraggable ( actions , isHeaderVisible ) ;
239+ const isDraggable = canEditCourseContent && model . isDraggable ( actions , isHeaderVisible ) ;
240240
241241 const titleComponent = depth < 2 ?
242242 (
@@ -328,6 +328,7 @@ const OutlineNode = ({
328328 titleComponent = { titleComponent }
329329 namePrefix = { levelConfig . name }
330330 actions = { actions }
331+ canEditCourseContent = { canEditCourseContent }
331332 extraActionsComponent = { extraActionsComponent }
332333 { ...( depth === 1
333334 ? { isSequential : true , proctoringExamConfigurationLink : blk . proctoringExamConfigurationLink }
@@ -352,7 +353,7 @@ const OutlineNode = ({
352353 data-testid = { levelConfig . contentTestId }
353354 onClick = { ( e ) => onClickCard ( e , false ) }
354355 >
355- { depth === 0 && onOpenHighlightsModal && (
356+ { canEditCourseContent && depth === 0 && onOpenHighlightsModal && (
356357 < div className = "outline-section__status mb-1" >
357358 < Button
358359 className = "p-0 bg-transparent"
@@ -381,14 +382,14 @@ const OutlineNode = ({
381382 } ) }
382383 >
383384 { children }
384- { actions . childAddable && (
385+ { canEditCourseContent && actions . childAddable && (
385386 < OutlineAddChildButtons
386387 childType = { levelConfig . containerType ! }
387388 parentLocator = { blk . id }
388389 grandParentLocator = { depth === 1 ? parentSection ?. id : undefined }
389390 />
390391 ) }
391- { showPaste && (
392+ { canEditCourseContent && showPaste && (
392393 < PasteComponent
393394 className = "mt-4 border-gray-500 rounded-0"
394395 text = { intl . formatMessage ( outlineNodeMessages . pasteButton ) }
0 commit comments