Fix getting tennat

This commit is contained in:
Urtzi Alfaro
2025-09-12 19:31:24 +02:00
parent 55f31a3630
commit 4c21a5e1b2
5 changed files with 46 additions and 34 deletions

View File

@@ -136,14 +136,6 @@ async def get_tenant_enhanced(
tenant_service: EnhancedTenantService = Depends(get_enhanced_tenant_service)
):
"""Get tenant by ID with enhanced data and access control"""
# Verify user has access to tenant
access = await tenant_service.verify_user_access(current_user["user_id"], str(tenant_id))
if not access.has_access:
raise HTTPException(
status_code=status.HTTP_403_FORBIDDEN,
detail="Access denied to tenant"
)
tenant = await tenant_service.get_tenant_by_id(str(tenant_id))
if not tenant:

View File

@@ -359,14 +359,7 @@ class EnhancedTenantService:
"""Get all team members for a tenant"""
try:
# Verify user has access to tenant
access = await self.verify_user_access(user_id, tenant_id)
if not access.has_access:
raise HTTPException(
status_code=status.HTTP_403_FORBIDDEN,
detail="Access denied to tenant"
)
members = await self.member_repo.get_tenant_members(
tenant_id, active_only=active_only
)