How do I hide projects based on what roles the user has?

You can try to hide the standard “Logout” buttons and then roll your own:

system.security.logout()
system.util.retarget("Main-Project")