mardi 15 décembre 2015

Allow admin users to see what other user type can see/do?

I have a Laravel web application consist of 2 types of user:

  1. customer
  2. admin

Base on their user type , they can see, and perform different things.


Customer

When log-in as customer, my customer will see different dashboard.


Admin

When log-in as admin, I can see a list of users in a table

Example,

  1. userA
  2. userB
  3. userC
  4. more …

Goal: I want to see what customer see when click on one of the user on the list.

I couldn’t come up the solution for that.


IMO

Will Auth::user()->type work for this scenario ?

The goal is to render the page as Auth:user()->type == ‘customer’, when the actual Auth::user()->type == ‘admin’. I'm not entirely sure if what I am trying to do is possible.


How would I do something like that in Laravel ? Am I on the right track ? How do I re-structure my application to achieve this kind of feature.

Any hints / suggestions ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire