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.
This commit is contained in:
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user