Plain App Router admin (aligned to habbo-next, no Refine): - rank surfaced on the NextAuth session; staff guard isStaff() [pure, unit-tested] + requireStaff() reading min_staff_rank, gating /admin. - /admin dashboard (counts), /admin/users (paginated + search), /admin/users/[id] detail. - src/actions/admin-users.ts: staff-gated server actions wiring the user editor to the existing services — giveCurrency (RCON or DB fallback), setMotto/setRank (DB + RCON), alertUser, disconnectUser. Verified: tsc exit 0, vitest 45/45, next build exit 0 (/admin routes).
5 lines
183 B
TypeScript
5 lines
183 B
TypeScript
/** AtomCMS housekeeping gate: staff are users with rank >= min_staff_rank. */
|
|
export function isStaff(rank: number, minStaffRank: number): boolean {
|
|
return rank >= minStaffRank;
|
|
}
|