mirror of https://github.com/jumpserver/jumpserver
fix: add settings for license version and facelive
parent
053d640e4c
commit
9b5509409c
|
@ -70,6 +70,13 @@ class ActionAclSerializer(serializers.Serializer):
|
|||
return
|
||||
if not settings.XPACK_LICENSE_IS_VALID:
|
||||
field_action._choices.pop(ActionChoices.review, None)
|
||||
if not (
|
||||
settings.XPACK_LICENSE_IS_VALID and
|
||||
settings.XPACK_LICENSE_EDITION_ULTIMATE and
|
||||
settings.FACE_RECOGNITION_ENABLED
|
||||
):
|
||||
field_action._choices.pop(ActionChoices.face_verify, None)
|
||||
field_action._choices.pop(ActionChoices.face_online, None)
|
||||
for choice in self.Meta.action_choices_exclude:
|
||||
field_action._choices.pop(choice, None)
|
||||
|
||||
|
|
|
@ -30,10 +30,11 @@ class MFAFace(BaseMFA, AuthFaceMixin):
|
|||
|
||||
@staticmethod
|
||||
def global_enabled():
|
||||
return settings.XPACK_LICENSE_IS_VALID \
|
||||
and LicenseEditionChoices.ULTIMATE == \
|
||||
LicenseEditionChoices.from_key(settings.XPACK_LICENSE_EDITION) \
|
||||
and settings.FACE_RECOGNITION_ENABLED
|
||||
return (
|
||||
settings.XPACK_LICENSE_IS_VALID and
|
||||
settings.XPACK_LICENSE_EDITION_ULTIMATE and
|
||||
settings.FACE_RECOGNITION_ENABLED
|
||||
)
|
||||
|
||||
def get_enable_url(self) -> str:
|
||||
return '/ui/#/profile/index'
|
||||
|
|
|
@ -19,6 +19,7 @@ XPACK_TEMPLATES_DIR = []
|
|||
XPACK_CONTEXT_PROCESSOR = []
|
||||
XPACK_LICENSE_IS_VALID = False
|
||||
XPACK_LICENSE_EDITION = ""
|
||||
XPACK_LICENSE_EDITION_ULTIMATE = False
|
||||
XPACK_LICENSE_INFO = {
|
||||
'corporation': corporation,
|
||||
}
|
||||
|
|
|
@ -34,6 +34,8 @@ class PrivateSettingSerializer(PublicSettingSerializer):
|
|||
PASSWORD_RULE = serializers.DictField()
|
||||
SECURITY_SESSION_SHARE = serializers.BooleanField()
|
||||
XPACK_LICENSE_IS_VALID = serializers.BooleanField()
|
||||
XPACK_LICENSE_EDITION_ULTIMATE = serializers.BooleanField()
|
||||
FACE_RECOGNITION_ENABLED = serializers.BooleanField()
|
||||
XPACK_LICENSE_INFO = serializers.DictField()
|
||||
HELP_DOCUMENT_URL = serializers.CharField()
|
||||
HELP_SUPPORT_URL = serializers.CharField()
|
||||
|
|
Loading…
Reference in New Issue