fix(admin): P0 integrity — permanent bans, ACL sidebar, rank guards
Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
11004626c7
commit
75cdfdebe4
14 files changed
+458
-68
No files matched your search
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Emulator-compatible ban expiry helpers.
|
||||
* `banExpire === 0` means permanent (Arcturus / Plus-style).
|
||||
*/
|
||||
|
||||
export function unixNow(): number {
|
||||
return Math.floor(Date.now() / 1000);
|
||||
}
|
||||
|
||||
export function isBanActive(
|
||||
banExpire: number,
|
||||
now: number = unixNow(),
|
||||
): boolean {
|
||||
return banExpire === 0 || banExpire > now;
|
||||
}
|
||||
|
||||
/** Prisma `where` fragment for currently active bans (incl. permanent). */
|
||||
export function activeBanWhere(now: number = unixNow()) {
|
||||
return {
|
||||
OR: [{ banExpire: 0 }, { banExpire: { gt: now } }],
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user