I want to be able to
I see ways to check if the user is in a particular role, but I don't care what role they participate. The database will know what roles are allowed to see what data. I need to submit a collection of these roles to the data service to filter the data based on those roles.
So first step is how do I get all roles associated with the current user in a controller method?
EDIT:
This seemed to work out nicely:
Roles.GetRolesForUser(User.Identity.Name)
Supporting answers still welcome.
Roles.GetRolesForUser(User.Identity.Name)
This can be done with a single statement:
User.IsInRole("admin");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With