diff --git a/cmd/app/db.go b/cmd/app/db.go index 0ee1584..2d5ed60 100644 --- a/cmd/app/db.go +++ b/cmd/app/db.go @@ -7,6 +7,14 @@ import ( "gorm.io/gorm" ) +func (u User) IsAdmin() bool { + return u.RoleBitmask&1 == 1 +} + +func (u User) IsEffectiveAdmin() bool { + return u.RoleBitmask&0b10 == 0b10 +} + type BotContent struct { gorm.Model Literal string diff --git a/cmd/app/main.go b/cmd/app/main.go index ba10d51..7a1f81b 100644 --- a/cmd/app/main.go +++ b/cmd/app/main.go @@ -24,14 +24,6 @@ type User struct { RoleBitmask uint } -func (u User) IsAdmin() bool { - return u.RoleBitmask&1 == 1 -} - -func (u User) IsEffectiveAdmin() bool { - return u.RoleBitmask&0b10 == 0b10 -} - type BotController struct { cfg config.Config bot *tgbotapi.BotAPI