I was thinking of the three legal states as:
- not logged in (
nullor{isAdmin: false, isLoggedIn: false}) - logged in as non-admin (
falseor{isAdmin: false, isLoggedIn: true}) - logged in as admin (
trueor{isAdmin: true, isLoggedIn: true})
which leaves {isAdmin: true, isLoggedIn: false} as an invalid, nonsensical state. (How would you know the user's an admin if they're not logged in?) Of course, in a different context, all four states could potentially be distinctly meaningful.