From ecd55a3031c4e86a9605280b822d50a6eba5c737 Mon Sep 17 00:00:00 2001 From: Akulij Date: Thu, 27 Mar 2025 22:02:14 +0800 Subject: [PATCH] improve panel handler security if later it will apear somewhere else that admin block --- cmd/app/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/app/main.go b/cmd/app/main.go index 513f37c..009cc29 100644 --- a/cmd/app/main.go +++ b/cmd/app/main.go @@ -135,6 +135,7 @@ func handleSecretCommand(bc BotController, update tgbotapi.Update, user User) { } func handlePanelCommand(bc BotController, update tgbotapi.Update, user User) { + if !user.IsAdmin() {return} if !user.IsEffectiveAdmin() { bc.db.Model(&user).Update("RoleBitmask", user.RoleBitmask|0b10) msg := tgbotapi.NewMessage(update.Message.Chat.ID, "You was in usermode, turned back to admin mode...")