File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -36,11 +36,16 @@ function setupCreatorForContentManager(creator) {
36
36
// Hide the "Add Question" button from the design surface
37
37
creator . showAddQuestionButton = false ;
38
38
creator . onElementAllowOperations . add ( ( _ , options ) => {
39
- if ( ! options . obj . isQuestion ) return ;
40
- // Disallow content managers to change question types, delete questions, or copy them
39
+ // Disallow restricted users to change question types, delete questions, or copy them
41
40
options . allowChangeType = false ;
42
41
options . allowCopy = false ;
43
- options . allowDelete = false ;
42
+ const obj = options . obj ;
43
+ if ( obj . isQuestion ) {
44
+ options . allowDelete = false ;
45
+ }
46
+ if ( obj . isPage || obj . isPanel ) {
47
+ options . allowDelete = obj . questions . length === 0 ;
48
+ }
44
49
} ) ;
45
50
creator . onCollectionItemAllowOperations . add ( ( _ , options ) => {
46
51
// Disallow content managers to delete columns via adorners on the design surface
You can’t perform that action at this time.
0 commit comments