|
|
|
|
@ -1,4 +1,3 @@
|
|
|
|
|
|
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
|
|
|
|
from services.enterprise.base import EnterpriseRequest
|
|
|
|
|
@ -18,12 +17,12 @@ class EnterpriseService:
|
|
|
|
|
return EnterpriseRequest.send_request("GET", "/info")
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def get_workspace_info(cls, tenant_id:str):
|
|
|
|
|
def get_workspace_info(cls, tenant_id: str):
|
|
|
|
|
return EnterpriseRequest.send_request("GET", f"/workspace/{tenant_id}/info")
|
|
|
|
|
|
|
|
|
|
class WebAppAuth:
|
|
|
|
|
@classmethod
|
|
|
|
|
def is_user_allowed_to_access_webapp(cls, user_id: str, app_code: str) -> bool:
|
|
|
|
|
def is_user_allowed_to_access_webapp(cls, user_id: str, app_code: str):
|
|
|
|
|
params = {"userId": user_id, "appCode": app_code}
|
|
|
|
|
data = EnterpriseRequest.send_request("GET", "/webapp/permission", params=params)
|
|
|
|
|
|
|
|
|
|
@ -70,7 +69,7 @@ class EnterpriseService:
|
|
|
|
|
return WebAppSettings(**data)
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def update_app_access_mode(cls, app_id: str, access_mode: str) -> bool:
|
|
|
|
|
def update_app_access_mode(cls, app_id: str, access_mode: str):
|
|
|
|
|
if not app_id:
|
|
|
|
|
raise ValueError("app_id must be provided.")
|
|
|
|
|
if access_mode not in ["public", "private", "private_all"]:
|
|
|
|
|
|