Jack Peeterson
Jack Peeterson

Reputation: 35

ASP.NET CORE MVC / How can i assign 2 Identity roles on same Controller

Basically i want to do this IMGUR

[Authorize(Roles = "Admin" )] <= Currently it's like this.
[Authorize(Roles = "Admin","SuperAdmin" )] <= I want to make it like this.

Basically i want to assign 2 identity roles at once to the same Controller,but I'm not sure how to format it properly. I made 2 identity roles, Admin and SuperAdmin, so i want SuperAdmin to be able to access everything that Admin can, so that's why i need to assign 2 identity roles on the same stuff.

Upvotes: 0

Views: 269

Answers (1)

Code_maniac
Code_maniac

Reputation: 278

Make it [Authorize(Roles = "Admin, SuperAdmin")]

Upvotes: 1

Related Questions