Fix getting tennat
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user