This mr makes sure that when users try to access a lab/course to which they are not enrolled, they will get redirected to the enroll page.
displays error message