소스 검색

Fix: the bug that allows regular users to add unregistered users to the workspace. (#328)

tags/0.3.2
Columbus 2 년 전
부모
커밋
5943385d42
No account linked to committer's email address
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5
    3
      api/services/account_service.py

+ 5
- 3
api/services/account_service.py 파일 보기

@@ -267,9 +267,10 @@ class TenantService:
}
if action not in ['add', 'remove', 'update']:
raise InvalidActionError("Invalid action.")

if operator.id == member.id:
raise CannotOperateSelfError("Cannot operate self.")
if member:
if operator.id == member.id:
raise CannotOperateSelfError("Cannot operate self.")

ta_operator = TenantAccountJoin.query.filter_by(
tenant_id=tenant.id,
@@ -365,6 +366,7 @@ class RegisterService:
account = Account.query.filter_by(email=email).first()

if not account:
TenantService.check_member_permission(tenant, inviter, None, 'add')
name = email.split('@')[0]
account = AccountService.create_account(email, name)
account.status = AccountStatus.PENDING.value

Loading…
취소
저장