File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -294,6 +294,7 @@ const factory = (crowi) => {
294294 this . isEmailPublished = configManager . getConfig (
295295 'customize:isEmailPublishedForNewUser' ,
296296 ) ;
297+ this . readOnly = configManager . getConfig ( 'app:isReadOnlyForNewUser' ) ;
297298
298299 this . save ( ( err , userData ) => {
299300 userEvent . emit ( 'activated' , userData ) ;
@@ -613,6 +614,8 @@ const factory = (crowi) => {
613614 newUser . lang = globalLang ;
614615 }
615616
617+ newUser . readOnly = configManager . getConfig ( 'app:isReadOnlyForNewUser' ) ;
618+
616619 try {
617620 const newUserData = await newUser . save ( ) ;
618621 return {
@@ -703,6 +706,8 @@ const factory = (crowi) => {
703706 'customize:isEmailPublishedForNewUser' ,
704707 ) ;
705708
709+ newUser . readOnly = configManager . getConfig ( 'app:isReadOnlyForNewUser' ) ;
710+
706711 const globalLang = configManager . getConfig ( 'app:globalLang' ) ;
707712 if ( globalLang != null ) {
708713 newUser . lang = globalLang ;
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ export const CONFIG_KEYS = [
7575 'app:wipPageExpirationSeconds' ,
7676 'app:openaiThreadDeletionCronMaxMinutesUntilRequest' ,
7777 'app:openaiVectorStoreFileDeletionCronMaxMinutesUntilRequest' ,
78+ 'app:isReadOnlyForNewUser' ,
7879
7980 // Security Settings
8081 'security:wikiMode' ,
@@ -526,6 +527,10 @@ export const CONFIG_DEFINITIONS = {
526527 envVarName : 'OPENAI_VECTOR_STORE_FILE_DELETION_CRON_MAX_MINUTES_UNTIL_REQUEST' ,
527528 defaultValue : 30 ,
528529 } ) ,
530+ 'app:isReadOnlyForNewUser' : defineConfig < boolean > ( {
531+ envVarName : 'DEFAULT_USER_READONLY' ,
532+ defaultValue : false ,
533+ } ) ,
529534
530535 // Security Settings
531536 'security:wikiMode' : defineConfig < string | undefined > ( {
You can’t perform that action at this time.
0 commit comments