Looking for a bit of advice and direction with access levels within Roles.
I have a MVC Project that makes use of AspNetRoles, for example I have the following roles set-up: Admin CustomerIndex CustomerCreate
In my Customer Controller I have:
[Authorize(Roles = "Admin, CustomerIndex")]
public ActionResult Index() ....
[Authorize(Roles = "Admin, CustomerCreate")]
public ActionResult Create() ...
What I want to do is restrict what the User can see and do based on his/her access level within the role.
Let's say I have the following Customers: ABC, DEF, XYZ
I want to grant different users read access to different customers, ie: User1 to have CustomerIndex role but only view data for ABC, DEF and then User2 to have CustomerIndex role but only for customer XYZ and then similar for the CustomerCreate role.
So if User1
runs to the Customer page, he will only be presented with the customer data for ABC, DEF
If User2 does the same, he will only see data for customer XYZ
What is the best way to achieve something like this?