Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialHalvard Bastiansen
Data Analysis Techdegree Student 14,886 PointsHow to view page content based on user types?
I just finished this course - https://teamtreehouse.com/library/user-authentication-with-express-and-mongo
In the course we learn how to hide content from non-logged in users and show new content to logged in users. But what if we have multiple types of users? For example student, teacher and admin.
Any idea how we can do that?
1 Answer
Steven Parker
231,269 PointsThe login process can establish the user type, and that can be used to prepare the pages. The actual technique will vary with the back-end language that is used.
I tend to work with C# and ASP.NET, which offers a role-based authorization system that can easily custom pages based on user roles.