mirror of https://github.com/jumpserver/jumpserver
Merge pull request #14663 from jumpserver/pr@dev@feat_exclude_some_action_for_acl
feat: exclude face action for login acl and command aclpull/14664/head
commit
7419139b29
|
@ -32,7 +32,9 @@ class CommandFilterACLSerializer(BaseSerializer, BulkOrgResourceModelSerializer)
|
||||||
class Meta(BaseSerializer.Meta):
|
class Meta(BaseSerializer.Meta):
|
||||||
model = CommandFilterACL
|
model = CommandFilterACL
|
||||||
fields = BaseSerializer.Meta.fields + ['command_groups']
|
fields = BaseSerializer.Meta.fields + ['command_groups']
|
||||||
action_choices_exclude = [ActionChoices.notice]
|
action_choices_exclude = [ActionChoices.notice,
|
||||||
|
ActionChoices.face_verify,
|
||||||
|
ActionChoices.face_online]
|
||||||
|
|
||||||
|
|
||||||
class CommandReviewSerializer(serializers.Serializer):
|
class CommandReviewSerializer(serializers.Serializer):
|
||||||
|
|
|
@ -4,6 +4,7 @@ from common.serializers import MethodSerializer
|
||||||
from orgs.mixins.serializers import BulkOrgResourceModelSerializer
|
from orgs.mixins.serializers import BulkOrgResourceModelSerializer
|
||||||
from .base import BaseUserACLSerializer
|
from .base import BaseUserACLSerializer
|
||||||
from .rules import RuleSerializer
|
from .rules import RuleSerializer
|
||||||
|
from ..const import ActionChoices
|
||||||
from ..models import LoginACL
|
from ..models import LoginACL
|
||||||
|
|
||||||
__all__ = ["LoginACLSerializer"]
|
__all__ = ["LoginACLSerializer"]
|
||||||
|
@ -17,6 +18,7 @@ class LoginACLSerializer(BaseUserACLSerializer, BulkOrgResourceModelSerializer):
|
||||||
class Meta(BaseUserACLSerializer.Meta):
|
class Meta(BaseUserACLSerializer.Meta):
|
||||||
model = LoginACL
|
model = LoginACL
|
||||||
fields = BaseUserACLSerializer.Meta.fields + ['rules', ]
|
fields = BaseUserACLSerializer.Meta.fields + ['rules', ]
|
||||||
|
action_choices_exclude = [ActionChoices.face_online, ActionChoices.face_verify]
|
||||||
|
|
||||||
def get_rules_serializer(self):
|
def get_rules_serializer(self):
|
||||||
return RuleSerializer()
|
return RuleSerializer()
|
||||||
|
|
Loading…
Reference in New Issue