mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-06 18:00:57 +00:00
perf: 优化控制 ACL Action Choices 的选项
This commit is contained in:
@@ -7,23 +7,16 @@ from common.db.models import JMSBaseModel
|
||||
from common.utils import contains_ip
|
||||
from common.utils.time_period import contains_time_period
|
||||
from orgs.mixins.models import OrgModelMixin, OrgManager
|
||||
from ..const import ActionChoices
|
||||
|
||||
__all__ = [
|
||||
'BaseACL', 'UserBaseACL', 'UserAssetAccountBaseACL',
|
||||
'ActionChoices',
|
||||
]
|
||||
|
||||
from orgs.utils import tmp_to_root_org
|
||||
from orgs.utils import tmp_to_org
|
||||
|
||||
|
||||
class ActionChoices(models.TextChoices):
|
||||
reject = 'reject', _('Reject')
|
||||
accept = 'accept', _('Accept')
|
||||
review = 'review', _('Review')
|
||||
warning = 'warning', _('Warning')
|
||||
|
||||
|
||||
class BaseACLQuerySet(models.QuerySet):
|
||||
def active(self):
|
||||
return self.filter(is_active=True)
|
||||
|
Reference in New Issue
Block a user