mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-11 03:46:52 +08:00
extract enum type for tenant account role (#3788)
This commit is contained in:
@@ -344,9 +344,9 @@ class TenantService:
|
||||
def check_member_permission(tenant: Tenant, operator: Account, member: Account, action: str) -> None:
|
||||
"""Check member permission"""
|
||||
perms = {
|
||||
'add': ['owner', 'admin'],
|
||||
'remove': ['owner'],
|
||||
'update': ['owner']
|
||||
'add': [TenantAccountRole.OWNER, TenantAccountRole.ADMIN],
|
||||
'remove': [TenantAccountRole.OWNER],
|
||||
'update': [TenantAccountRole.OWNER]
|
||||
}
|
||||
if action not in ['add', 'remove', 'update']:
|
||||
raise InvalidActionError("Invalid action.")
|
||||
|
||||
Reference in New Issue
Block a user