AFAIK, Moodle does what you want by default. Don't be fooled by looking as yourself or using the switch role to . . . Login as a student (use login as button or make a fake student).
When student logs in, they only see the courses they're enrolled in. If that doesn't happen, you've got a problem.