From 192b2ed51cf13f2664d2a2be8cc8c718ac3895d6 Mon Sep 17 00:00:00 2001 From: Armatik Date: Thu, 25 Apr 2024 15:42:17 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20id=20=D1=80=D0=BE=D0=BB=D0=B8=20=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/standard/roles/{api.py => roles.py} | 13 +++++++++++++ 1 file changed, 13 insertions(+) rename src/modules/standard/roles/{api.py => roles.py} (76%) diff --git a/src/modules/standard/roles/api.py b/src/modules/standard/roles/roles.py similarity index 76% rename from src/modules/standard/roles/api.py rename to src/modules/standard/roles/roles.py index 1a76e63..928abfa 100644 --- a/src/modules/standard/roles/api.py +++ b/src/modules/standard/roles/roles.py @@ -41,3 +41,16 @@ class Roles: return self.bot case _: raise ValueError(f"Нет роли с id={role_id}") + + async def get_user_permission(self, user_id): + match get_user_role(user_id): + case self.admin_role_id: + return self.admin + case self.moderator_role_id: + return self.moderator + case self.user_role_id: + return self.user + case self.bot_role_id: + return self.bot + case _: + return None