feat: enhance app access control by implementing batch permission checks for installed apps

This commit is contained in:
GareArc
2025-08-01 15:29:32 +08:00
parent 390e4cc0bf
commit f6272dbb88
2 changed files with 37 additions and 10 deletions

View File

@ -52,6 +52,16 @@ class EnterpriseService:
return data.get("result", False)
@classmethod
def batch_is_user_allowed_to_access_webapps(cls, user_id: str, app_codes: list[str]):
if not app_codes:
return {}
body = {"userId": user_id, "appCodes": app_codes}
data = EnterpriseRequest.send_request("POST", "/webapp/permission/batch", json=body)
if not data:
raise ValueError("No data found.")
return data.get("permissions", {})
@classmethod
def get_app_access_mode_by_id(cls, app_id: str) -> WebAppSettings:
if not app_id: