This commit is contained in:
2026-03-23 18:55:27 +07:00
parent 6dc0322fe5
commit 3626c12319
47 changed files with 2741 additions and 0 deletions

27
pkg/constant/role.go Normal file
View File

@@ -0,0 +1,27 @@
package constant
type Role string
const (
ADMIN Role = "ADMIN"
MOD Role = "MOD"
USER Role = "USER"
HISTORIAN Role = "HISTORIAN"
BANNED Role = "BANNED"
)
func (r Role) String() string {
return string(r)
}
func (r Role) Compare(other Role) bool {
return r == other
}
func CheckValidRole(r Role) bool {
return r == ADMIN || r == MOD || r == HISTORIAN || r == USER || r == BANNED
}
func (r Role) ToSlice() []string {
return []string{r.String()}
}