Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

minor fix: fix dissolve tenant check permission always failed (#22292)

NeatGuyCodingcbc3474bbb79
diff --git a/api/services/account_service.py b/api/services/account_service.py
index feabd436565..c13ae7a4f03 100644
--- a/api/services/account_service.py
+++ b/api/services/account_service.py
@@ -1070,8 +1070,8 @@ class TenantService:
@staticmethod
def dissolve_tenant(tenant: Tenant, operator: Account) -> None:
"""Dissolve tenant"""
- if not TenantService.check_member_permission(tenant, operator, operator, "remove"):
- raise NoPermissionError("No permission to dissolve tenant.")
+ TenantService.check_member_permission(tenant, operator, None, "remove")
+
db.session.query(TenantAccountJoin).filter_by(tenant_id=tenant.id).delete()
db.session.delete(tenant)
db.session.commit()