mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
feat(modal): refactor modal types and integrate security action requirements
This commit is contained in:
@@ -9,10 +9,3 @@ export function parseTotpEnabled(tokenValue: string | null) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export function needsAdminTotp(totpEnabled: boolean, currentRoles: number, nextRoles: number) {
|
||||
if (!totpEnabled) return false;
|
||||
const nextHasAdmin = (nextRoles & 4) !== 0;
|
||||
const alreadyAdmin = (currentRoles & 4) !== 0;
|
||||
return nextHasAdmin && !alreadyAdmin;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user