refac
This commit is contained in:
@@ -1300,6 +1300,10 @@ USER_PERMISSIONS_WORKSPACE_TOOLS_ACCESS = (
|
|||||||
os.environ.get("USER_PERMISSIONS_WORKSPACE_TOOLS_ACCESS", "False").lower() == "true"
|
os.environ.get("USER_PERMISSIONS_WORKSPACE_TOOLS_ACCESS", "False").lower() == "true"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
USER_PERMISSIONS_WORKSPACE_SKILLS_ACCESS = (
|
||||||
|
os.environ.get("USER_PERMISSIONS_WORKSPACE_SKILLS_ACCESS", "False").lower() == "true"
|
||||||
|
)
|
||||||
|
|
||||||
USER_PERMISSIONS_WORKSPACE_MODELS_IMPORT = (
|
USER_PERMISSIONS_WORKSPACE_MODELS_IMPORT = (
|
||||||
os.environ.get("USER_PERMISSIONS_WORKSPACE_MODELS_IMPORT", "False").lower()
|
os.environ.get("USER_PERMISSIONS_WORKSPACE_MODELS_IMPORT", "False").lower()
|
||||||
== "true"
|
== "true"
|
||||||
@@ -1521,6 +1525,7 @@ DEFAULT_USER_PERMISSIONS = {
|
|||||||
"knowledge": USER_PERMISSIONS_WORKSPACE_KNOWLEDGE_ACCESS,
|
"knowledge": USER_PERMISSIONS_WORKSPACE_KNOWLEDGE_ACCESS,
|
||||||
"prompts": USER_PERMISSIONS_WORKSPACE_PROMPTS_ACCESS,
|
"prompts": USER_PERMISSIONS_WORKSPACE_PROMPTS_ACCESS,
|
||||||
"tools": USER_PERMISSIONS_WORKSPACE_TOOLS_ACCESS,
|
"tools": USER_PERMISSIONS_WORKSPACE_TOOLS_ACCESS,
|
||||||
|
"skills": USER_PERMISSIONS_WORKSPACE_SKILLS_ACCESS,
|
||||||
"models_import": USER_PERMISSIONS_WORKSPACE_MODELS_IMPORT,
|
"models_import": USER_PERMISSIONS_WORKSPACE_MODELS_IMPORT,
|
||||||
"models_export": USER_PERMISSIONS_WORKSPACE_MODELS_EXPORT,
|
"models_export": USER_PERMISSIONS_WORKSPACE_MODELS_EXPORT,
|
||||||
"prompts_import": USER_PERMISSIONS_WORKSPACE_PROMPTS_IMPORT,
|
"prompts_import": USER_PERMISSIONS_WORKSPACE_PROMPTS_IMPORT,
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ class WorkspacePermissions(BaseModel):
|
|||||||
knowledge: bool = False
|
knowledge: bool = False
|
||||||
prompts: bool = False
|
prompts: bool = False
|
||||||
tools: bool = False
|
tools: bool = False
|
||||||
|
skills: bool = False
|
||||||
models_import: bool = False
|
models_import: bool = False
|
||||||
models_export: bool = False
|
models_export: bool = False
|
||||||
prompts_import: bool = False
|
prompts_import: bool = False
|
||||||
|
|||||||
@@ -158,6 +158,29 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col w-full">
|
||||||
|
<Tooltip
|
||||||
|
className="flex w-full justify-between my-1"
|
||||||
|
content={$i18n.t(
|
||||||
|
'Warning: Enabling this will allow users to upload arbitrary code on the server.'
|
||||||
|
)}
|
||||||
|
placement="top-start"
|
||||||
|
>
|
||||||
|
<div class=" self-center text-xs font-medium">
|
||||||
|
{$i18n.t('Skills Access')}
|
||||||
|
</div>
|
||||||
|
<Switch bind:state={permissions.workspace.skills} />
|
||||||
|
</Tooltip>
|
||||||
|
|
||||||
|
{#if defaultPermissions?.workspace?.skills && !permissions.workspace.skills}
|
||||||
|
<div class="pb-0.5">
|
||||||
|
<div class="text-xs text-gray-500">
|
||||||
|
{$i18n.t('This is a default user permission and will remain enabled.')}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr class=" border-gray-100/30 dark:border-gray-850/30" />
|
<hr class=" border-gray-100/30 dark:border-gray-850/30" />
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export const DEFAULT_PERMISSIONS = {
|
|||||||
knowledge: false,
|
knowledge: false,
|
||||||
prompts: false,
|
prompts: false,
|
||||||
tools: false,
|
tools: false,
|
||||||
|
skills: false,
|
||||||
models_import: false,
|
models_import: false,
|
||||||
models_export: false,
|
models_export: false,
|
||||||
prompts_import: false,
|
prompts_import: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user