mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-14 14:29:21 +00:00
feat: user login acl (#6963)
* feat: user login acl * 添加分时登陆 * acl 部分还原 * 简化acl判断逻辑 Co-authored-by: feng626 <1304903146@qq.com> Co-authored-by: feng626 <57284900+feng626@users.noreply.github.com>
This commit is contained in:
@@ -17,6 +17,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils import timezone
|
||||
from django.shortcuts import reverse
|
||||
|
||||
from acls.models import LoginACL
|
||||
from orgs.utils import current_org
|
||||
from orgs.models import OrganizationMember, Organization
|
||||
from common.exceptions import JMSException
|
||||
@@ -148,13 +149,6 @@ class AuthMixin:
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_login_confirm_setting(self):
|
||||
if hasattr(self, 'login_confirm_setting'):
|
||||
s = self.login_confirm_setting
|
||||
if s.reviewers.all().count() and s.is_active:
|
||||
return s
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def get_public_key_body(key):
|
||||
for i in key.split():
|
||||
@@ -758,11 +752,6 @@ class User(AuthMixin, TokenMixin, RoleMixin, MFAMixin, AbstractUser):
|
||||
user_default = settings.STATIC_URL + "img/avatar/user.png"
|
||||
return user_default
|
||||
|
||||
# def admin_orgs(self):
|
||||
# from orgs.models import Organization
|
||||
# orgs = Organization.get_user_admin_or_audit_orgs(self)
|
||||
# return orgs
|
||||
|
||||
def avatar_url(self):
|
||||
admin_default = settings.STATIC_URL + "img/avatar/admin.png"
|
||||
user_default = settings.STATIC_URL + "img/avatar/user.png"
|
||||
|
Reference in New Issue
Block a user