mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-28 01:31:28 +00:00
. (#171)
This commit is contained in:
parent
8921a01660
commit
13c53b89c1
1 changed files with 4 additions and 0 deletions
|
|
@ -2881,6 +2881,8 @@ async def upload_file_to_terminal(
|
|||
local_path = Storage.get_file(file_record.path)
|
||||
|
||||
# --- 2. Resolve terminal connection ---
|
||||
from open_webui.utils.access_control import has_connection_access
|
||||
|
||||
terminal_url = None
|
||||
headers = {}
|
||||
|
||||
|
|
@ -2889,6 +2891,8 @@ async def upload_file_to_terminal(
|
|||
(c for c in connections if c.get('id') == terminal_id), None
|
||||
)
|
||||
if connection:
|
||||
if not has_connection_access(UserModel(**__user__), connection):
|
||||
return json.dumps({'error': 'Access denied to terminal server'})
|
||||
terminal_url = connection.get('url', '').rstrip('/')
|
||||
auth_type = connection.get('auth_type', 'bearer')
|
||||
if auth_type == 'bearer':
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue