mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-18 05:55:59 +08:00
Revert "Merge branch 'fix/workspace-permission' into deploy/dev"
This reverts commit 1d5a126baa8a522fee3c0284a231819d3a5130dc, reversing changes made to 418e0fa831225db9f8f17fe174a6fc7df923513a.
This commit is contained in:
parent
1d5a126baa
commit
2d1de776d4
@ -46,7 +46,6 @@ from services.errors.account import (
|
|||||||
LinkAccountIntegrateError,
|
LinkAccountIntegrateError,
|
||||||
MemberNotInTenantError,
|
MemberNotInTenantError,
|
||||||
NoPermissionError,
|
NoPermissionError,
|
||||||
RemoveOwnerError,
|
|
||||||
RoleAlreadyAssignedError,
|
RoleAlreadyAssignedError,
|
||||||
TenantNotFoundError,
|
TenantNotFoundError,
|
||||||
)
|
)
|
||||||
@ -790,9 +789,6 @@ class TenantService:
|
|||||||
|
|
||||||
ta_operator = TenantAccountJoin.query.filter_by(tenant_id=tenant.id, account_id=operator.id).first()
|
ta_operator = TenantAccountJoin.query.filter_by(tenant_id=tenant.id, account_id=operator.id).first()
|
||||||
|
|
||||||
logging.info(
|
|
||||||
f"Tenant {tenant.id} operator {operator.id} with role {ta_operator.role} is trying to {action} member {member.id if member else None}"
|
|
||||||
)
|
|
||||||
if not ta_operator or ta_operator.role not in perms[action]:
|
if not ta_operator or ta_operator.role not in perms[action]:
|
||||||
raise NoPermissionError(f"No permission to {action} member.")
|
raise NoPermissionError(f"No permission to {action} member.")
|
||||||
|
|
||||||
@ -804,11 +800,6 @@ class TenantService:
|
|||||||
|
|
||||||
TenantService.check_member_permission(tenant, operator, account, "remove")
|
TenantService.check_member_permission(tenant, operator, account, "remove")
|
||||||
|
|
||||||
# Additional check to ensure the target account is not owner
|
|
||||||
if TenantService.get_user_role(account, tenant) == TenantAccountRole.OWNER:
|
|
||||||
raise RemoveOwnerError("Cannot remove owner from tenant.")
|
|
||||||
|
|
||||||
|
|
||||||
ta = TenantAccountJoin.query.filter_by(tenant_id=tenant.id, account_id=account.id).first()
|
ta = TenantAccountJoin.query.filter_by(tenant_id=tenant.id, account_id=account.id).first()
|
||||||
if not ta:
|
if not ta:
|
||||||
raise MemberNotInTenantError("Member not in tenant.")
|
raise MemberNotInTenantError("Member not in tenant.")
|
||||||
|
@ -53,10 +53,6 @@ class MemberNotInTenantError(BaseServiceError):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class RemoveOwnerError(BaseServiceError):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class RoleAlreadyAssignedError(BaseServiceError):
|
class RoleAlreadyAssignedError(BaseServiceError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user