In ASP.NET MVC 4 and below we just add the following in Global.asax:
GlobalFilters.Filters.Add(new AuthorizeAttribute() { Roles = \"Admin, S
You can also use the below code. This is using a type rather than an instance.
services.AddMvc(options => { options.Filters.Add(typeof(AuthorizeFilter)); });
And using Dependency Injection you can resolve the policy Object.