mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-11 12:19:41 +00:00
perf: 登录资产的 ACL 支持 ip 控制 (#10581)
Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
@@ -340,15 +340,14 @@ class AuthACLMixin:
|
||||
|
||||
def _check_login_acl(self, user, ip):
|
||||
# ACL 限制用户登录
|
||||
acl = LoginACL.match(user, ip)
|
||||
acl = LoginACL.get_match_rule_acls(user, ip)
|
||||
if not acl:
|
||||
return
|
||||
|
||||
acl: LoginACL
|
||||
if acl.is_action(acl.ActionChoices.accept):
|
||||
if acl.is_action(LoginACL.ActionChoices.accept):
|
||||
return
|
||||
|
||||
if acl.is_action(acl.ActionChoices.reject):
|
||||
if acl.is_action(LoginACL.ActionChoices.reject):
|
||||
raise errors.LoginACLIPAndTimePeriodNotAllowed(user.username, request=self.request)
|
||||
|
||||
if acl.is_action(acl.ActionChoices.review):
|
||||
|
Reference in New Issue
Block a user