File tree Expand file tree Collapse file tree 5 files changed +25
-1
lines changed Expand file tree Collapse file tree 5 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -1284,6 +1284,10 @@ def feishu_oauth_register(oauth: OAuth):
12841284 os .environ .get ("USER_PERMISSIONS_CHAT_ATTACH_KONWLEDGE" , "True" ).lower () == "true"
12851285)
12861286
1287+ USER_PERMISSIONS_EXPORT_IMPORT_MODEL = (
1288+ os .environ .get ("USER_PERMISSIONS_EXPORT_IMPORT_MODEL" , "True" ).lower () == "true"
1289+ )
1290+
12871291USER_PERMISSIONS_CHAT_PARAMS = (
12881292 os .environ .get ("USER_PERMISSIONS_CHAT_PARAMS" , "True" ).lower () == "true"
12891293)
@@ -1395,6 +1399,7 @@ def feishu_oauth_register(oauth: OAuth):
13951399 "system_prompt" : USER_PERMISSIONS_CHAT_SYSTEM_PROMPT ,
13961400 "image_capture" : USER_PERMISSIONS_CHAT_IMAGE_CAPTURE ,
13971401 "attach_knowledge" : USER_PERMISSIONS_CHAT_ATTACH_KONWLEDGE ,
1402+ "export_import_model" : USER_PERMISSIONS_EXPORT_IMPORT_MODEL ,
13981403 "params" : USER_PERMISSIONS_CHAT_PARAMS ,
13991404 "file_upload" : USER_PERMISSIONS_CHAT_FILE_UPLOAD ,
14001405 "delete" : USER_PERMISSIONS_CHAT_DELETE ,
Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ class ChatPermissions(BaseModel):
166166 system_prompt : bool = True
167167 image_capture : bool = True
168168 attach_knowledge : bool = True
169+ export_import_model : bool = True
169170 params : bool = True
170171 file_upload : bool = True
171172 delete : bool = True
Original file line number Diff line number Diff line change 5353 system_prompt: true ,
5454 image_capture: true ,
5555 attach_knowledge: true ,
56+ export_import_model: true ,
5657 params: true ,
5758 file_upload: true ,
5859 delete: true ,
Original file line number Diff line number Diff line change 2727 params: true ,
2828 image_capture: true ,
2929 attach_knowledge: true ,
30+ export_import_model: true ,
3031 file_upload: true ,
3132 delete: true ,
3233 delete_message: true ,
377378 {/if }
378379 </div >
379380
381+ <div class =" flex flex-col w-full" >
382+ <div class =" flex w-full justify-between my-1" >
383+ <div class =" self-center text-xs font-medium" >
384+ {$i18n .t (' Allow Import/Export models' )}
385+ </div >
386+ <Switch bind:state ={permissions .chat .export_import_model } />
387+ </div >
388+ {#if defaultPermissions ?.chat ?.export_import_model && ! permissions .chat .export_import_model }
389+ <div >
390+ <div class =" text-xs text-gray-500" >
391+ {$i18n .t (' This is a default user permission and will remain enabled.' )}
392+ </div >
393+ </div >
394+ {/if }
395+ </div >
396+
380397 <div class =" flex flex-col w-full" >
381398 <div class =" flex w-full justify-between my-1" >
382399 <div class =" self-center text-xs font-medium" >
Original file line number Diff line number Diff line change 308308 </div >
309309
310310 <div class =" flex w-full justify-end gap-1.5" >
311- {#if $user ?.role === ' admin' }
311+ {#if $user ?.role === ' admin' || $user ?. permissions . chat ?. export_import_model }
312312 <button
313313 class =" flex text-xs items-center space-x-1 px-3 py-1.5 rounded-xl bg-gray-50 hover:bg-gray-100 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-200 transition"
314314 on:click ={() => {
You can’t perform that action at this time.
0 commit comments