mirror of
https://github.com/open-webui/open-webui
synced 2025-06-22 18:07:17 +00:00
Added permission to enable/disable image capture
This commit is contained in:
parent
e05560a49d
commit
e24758f54b
@ -1081,6 +1081,10 @@ USER_PERMISSIONS_CHAT_SYSTEM_PROMPT = (
|
||||
os.environ.get("USER_PERMISSIONS_CHAT_SYSTEM_PROMPT", "True").lower() == "true"
|
||||
)
|
||||
|
||||
USER_PERMISSIONS_CHAT_IMAGE_CAPTURE = (
|
||||
os.environ.get("USER_PERMISSIONS_CHAT_IMAGE_CAPTURE", "True").lower() == "true"
|
||||
)
|
||||
|
||||
USER_PERMISSIONS_CHAT_FILE_UPLOAD = (
|
||||
os.environ.get("USER_PERMISSIONS_CHAT_FILE_UPLOAD", "True").lower() == "true"
|
||||
)
|
||||
@ -1167,6 +1171,7 @@ DEFAULT_USER_PERMISSIONS = {
|
||||
"chat": {
|
||||
"controls": USER_PERMISSIONS_CHAT_CONTROLS,
|
||||
"system_prompt": USER_PERMISSIONS_CHAT_SYSTEM_PROMPT,
|
||||
"image_capture": USER_PERMISSIONS_CHAT_IMAGE_CAPTURE,
|
||||
"file_upload": USER_PERMISSIONS_CHAT_FILE_UPLOAD,
|
||||
"delete": USER_PERMISSIONS_CHAT_DELETE,
|
||||
"edit": USER_PERMISSIONS_CHAT_EDIT,
|
||||
|
@ -134,6 +134,7 @@ class SharingPermissions(BaseModel):
|
||||
class ChatPermissions(BaseModel):
|
||||
controls: bool = True
|
||||
system_prompt: bool = True
|
||||
image_capture: bool = True
|
||||
file_upload: bool = True
|
||||
delete: bool = True
|
||||
edit: bool = True
|
||||
|
@ -66,6 +66,7 @@
|
||||
chat: {
|
||||
controls: true,
|
||||
system_prompt: true,
|
||||
image_capture: true,
|
||||
file_upload: true,
|
||||
delete: true,
|
||||
edit: true,
|
||||
|
@ -46,6 +46,7 @@
|
||||
},
|
||||
chat: {
|
||||
controls: true,
|
||||
image_capture: true,
|
||||
file_upload: true,
|
||||
delete: true,
|
||||
edit: true,
|
||||
|
@ -21,6 +21,7 @@
|
||||
},
|
||||
chat: {
|
||||
controls: true,
|
||||
image_capture: true,
|
||||
file_upload: true,
|
||||
delete: true,
|
||||
edit: true,
|
||||
@ -271,6 +272,14 @@
|
||||
<Switch bind:state={permissions.chat.system_prompt} />
|
||||
</div>
|
||||
|
||||
<div class=" flex w-full justify-between my-2 pr-2">
|
||||
<div class=" self-center text-xs font-medium">
|
||||
{$i18n.t('Allow Image capture')}
|
||||
</div>
|
||||
|
||||
<Switch bind:state={permissions.chat.image_capture} />
|
||||
</div>
|
||||
|
||||
<div class=" flex w-full justify-between my-2 pr-2">
|
||||
<div class=" self-center text-xs font-medium">
|
||||
{$i18n.t('Allow Chat Delete')}
|
||||
|
@ -173,6 +173,7 @@
|
||||
<hr class="border-black/5 dark:border-white/5 my-1" />
|
||||
{/if}
|
||||
|
||||
{#if $user?.role === 'admin' || $user?.permissions.chat?.image_capture}
|
||||
<Tooltip
|
||||
content={fileUploadCapableModels.length !== selectedModels.length
|
||||
? $i18n.t('Model(s) do not support file upload')
|
||||
@ -203,6 +204,7 @@
|
||||
<div class=" line-clamp-1">{$i18n.t('Capture')}</div>
|
||||
</DropdownMenu.Item>
|
||||
</Tooltip>
|
||||
{/if}
|
||||
|
||||
<Tooltip
|
||||
content={fileUploadCapableModels.length !== selectedModels.length
|
||||
|
Loading…
Reference in New Issue
Block a user