[Update] 用户列表添加移除操作(在其他组织中) (#3513)

* [Update] 用户列表添加移除操作(在其他组织中)

* [Update] 用户列表添加移除操作(在其他组织中)2
This commit is contained in:
BaiJiangJie
2019-12-09 11:50:52 +08:00
committed by GitHub
parent c5785e17aa
commit 16864ca34e
8 changed files with 151 additions and 88 deletions

View File

@@ -267,6 +267,16 @@ class RoleMixin:
access_key = app.create_access_key()
return app, access_key
def remove(self):
if not current_org.is_real():
return
if self.can_user_current_org:
current_org.users.remove(self)
if self.can_admin_current_org:
current_org.admins.remove(self)
if self.can_audit_current_org:
current_org.auditors.remove(self)
class TokenMixin:
CACHE_KEY_USER_RESET_PASSWORD_PREFIX = "_KEY_USER_RESET_PASSWORD_{}"