you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 11 months ago (1 child)

Admin false LoggedIn false doesn't feel illegal to me, more redundant if anything

  • source
  • parent
  • hideshow 2 child comments
  • [–] 9 points 11 months ago* (2 children)

    I was thinking of the three legal states as:

    • not logged in (null or {isAdmin: false, isLoggedIn: false})
    • logged in as non-admin (false or {isAdmin: false, isLoggedIn: true})
    • logged in as admin (true or {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.

  • source
  • parent
  • hideshow 4 child comments