add ruff format, ruff check, time_picker, project structure and imports reorganized

This commit is contained in:
Alexander Kalinovsky committed 2025-01-21 23:50:19 +01:00
1 parent ced47ac993
commit 9dd0708a5b
58 files changed
+3690 -2583

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
from ..model.settings import Settings
from ..model.user import UserBase
from ..bot.handlers.context import ContextData, CallbackCommand, CommandContext
async def authorize_command(user: UserBase, callback_data: ContextData):
if (
callback_data.command == CallbackCommand.MENU_ENTRY_PARAMETERS
or callback_data.context == CommandContext.SETTING_EDIT
):
allowed_roles = await Settings.get(Settings.SECURITY_PARAMETERS_ROLES)
return any(role in user.roles for role in allowed_roles)
return False