fix: isolate registered project folders by tenant

This commit is contained in:
Hamza Ayed
2026-10-04 02:04:14 +03:00
parent 1feeb372a4
commit 5ab7ec2713
4 changed files with 58 additions and 3 deletions
+3 -1
View File
@@ -263,8 +263,10 @@ async def register_agent_project(
raise HTTPException(status_code=403, detail="تسجيل مجلدات المشاريع متاح من هذا الجهاز فقط.")
try:
root = workspace.validate_workspace_registration(request.workspace_path)
workspace.validate_workspace_registration_isolation(root, user_id)
except ValueError as exc:
raise HTTPException(status_code=422, detail=str(exc)) from exc
status_code = 409 if "يتداخل" in str(exc) else 422
raise HTTPException(status_code=status_code, detail=str(exc)) from exc
try:
database.register_workspace_root(user_id, str(root))
except ValueError as exc: