Make sure invalid user ids are logged out
Added permissioning for teachers and students