Implement account management features in API, including endpoints for listing accounts and updating account roles. Introduce moderator role with associated permissions, and refactor access control checks to accommodate staff roles. Update database schema to support new role constraints and enhance frontend navigation for staff access.
Some checks failed
CI / backend (push) Has been cancelled
CI / frontend (push) Has been cancelled
CI / compose (push) Has been cancelled

This commit is contained in:
2026-07-19 02:32:15 +03:00
parent 4b889fb8a0
commit 1a5a39baf0
18 changed files with 726 additions and 74 deletions

View File

@@ -22,8 +22,9 @@ type ID string
type GlobalRole string
const (
RolePlayer GlobalRole = "player"
RoleAdmin GlobalRole = "admin"
RolePlayer GlobalRole = "player"
RoleModerator GlobalRole = "moderator"
RoleAdmin GlobalRole = "admin"
)
type Account struct {
@@ -36,6 +37,7 @@ type Account struct {
}
func (a Account) IsAdmin() bool { return a.Role == RoleAdmin }
func (a Account) IsStaff() bool { return a.Role == RoleAdmin || a.Role == RoleModerator }
type Ratings struct {
Tank int `json:"tank"`