vendredi 22 mai 2015

controller logic for two different type of users

In my project i have three different categories of users:

Guest
Registered
Admin

If a Registered user is logged , i want to show him (if he clicks on a button) his orders. The admin , instead , can see the orders of the other users. I can use OrderController to show things to the registered user. Is necessary to create a new controller for the admin , or i have to use an "if the user is a admin do this " in the same controller that i use for the registerd user?

Thank you programmers

Aucun commentaire:

Enregistrer un commentaire