38 lines
1.1 KiB
Go
38 lines
1.1 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
// AdminRole is a named set of admin-panel permissions.
|
|
type AdminRole struct {
|
|
ID string `json:"id"`
|
|
Key string `json:"key"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
IsSystem bool `json:"is_system"`
|
|
Permissions []string `json:"permissions"`
|
|
// MemberCount is how many staff hold the role, for the roles screen.
|
|
MemberCount int `json:"member_count"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
// StaffMember is one account with admin-panel access.
|
|
type StaffMember struct {
|
|
UserID string `json:"user_id"`
|
|
Handle string `json:"handle"`
|
|
Name string `json:"name"`
|
|
Email *string `json:"email,omitempty"`
|
|
AvatarURL *string `json:"avatar_url,omitempty"`
|
|
RoleID string `json:"role_id"`
|
|
RoleKey string `json:"role_key"`
|
|
RoleName string `json:"role_name"`
|
|
BlockedAt *time.Time `json:"blocked_at,omitempty"`
|
|
}
|
|
|
|
// StaffAccess is what the admin middleware needs about the caller.
|
|
type StaffAccess struct {
|
|
RoleKey string
|
|
RoleName string
|
|
Permissions []string
|
|
Blocked bool
|
|
}
|