From efd78ddffb82d3fb2a537bc43c03e5e1fb0f8a04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Thu, 23 Nov 2023 17:06:03 +0100 Subject: [PATCH] Added MFA permission --- server/src/uds/REST/methods/permissions.py | 1 + server/src/uds/core/util/objtype.py | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/server/src/uds/REST/methods/permissions.py b/server/src/uds/REST/methods/permissions.py index 9d854b8cc..4fc43f0de 100644 --- a/server/src/uds/REST/methods/permissions.py +++ b/server/src/uds/REST/methods/permissions.py @@ -67,6 +67,7 @@ def getClass(arg: str) -> typing.Type['Model']: 'calendars': models.Calendar, 'metapools': models.MetaPool, 'accounts': models.Account, + 'mfa': models.MFA, }.get(arg, None) if cls is None: diff --git a/server/src/uds/core/util/objtype.py b/server/src/uds/core/util/objtype.py index 276af86e4..881a6db57 100644 --- a/server/src/uds/core/util/objtype.py +++ b/server/src/uds/core/util/objtype.py @@ -62,16 +62,17 @@ class ObjectType(enum.Enum): STATS_EVENTS = ObjTypeInfo(12, models.StatsEvents) CALENDAR = ObjTypeInfo(13, models.Calendar) CALENDAR_RULE = ObjTypeInfo(14, models.CalendarRule) - # PROXY_TYPE = (15, models.Proxy) has been removed - METAPOOL = ObjTypeInfo(16, models.MetaPool) - ACCOUNT = ObjTypeInfo(17, models.Account) - REGISTERED_SERVER = ObjTypeInfo(19, models.Server) - ACCOUNT_USAGE = ObjTypeInfo(20, models.AccountUsage) - IMAGE = ObjTypeInfo(21, models.Image) - LOG = ObjTypeInfo(22, models.Log) - NOTIFICATION = ObjTypeInfo(23, models.Notification) - TICKET_STORE = ObjTypeInfo(24, models.TicketStore) - REGISTERED_SERVER_GROUP = ObjTypeInfo(26, models.ServerGroup) + METAPOOL = ObjTypeInfo(15, models.MetaPool) + ACCOUNT = ObjTypeInfo(16, models.Account) + # Actor and Tunnel tokens are now on REGISTERED_SERVER, so removed + MFA = ObjTypeInfo(19, models.MFA) + REGISTERED_SERVER = ObjTypeInfo(20, models.Server) + REGISTERED_SERVER_GROUP = ObjTypeInfo(21, models.ServerGroup) + ACCOUNT_USAGE = ObjTypeInfo(22, models.AccountUsage) + IMAGE = ObjTypeInfo(23, models.Image) + LOG = ObjTypeInfo(24, models.Log) + NOTIFICATION = ObjTypeInfo(25, models.Notification) + TICKET_STORE = ObjTypeInfo(26, models.TicketStore) @property def model(self) -> typing.Type['Model']: