Adding authorization policy for the missed startup class.

This commit is contained in:
Praburaj 2015-01-16 10:05:53 -08:00
parent f67f577ad2
commit 9e68b43069
1 changed files with 7 additions and 0 deletions

View File

@ -7,6 +7,7 @@ using Microsoft.AspNet.Diagnostics.Entity;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Routing;
using Microsoft.AspNet.Security;
using Microsoft.AspNet.Security.Facebook;
using Microsoft.AspNet.Security.Google;
using Microsoft.AspNet.Security.MicrosoftAccount;
@ -109,6 +110,12 @@ namespace MusicStore
//Add InMemoryCache
services.AddSingleton<IMemoryCache, MemoryCache>();
// Configure Auth
services.Configure<AuthorizationOptions>(options =>
{
options.AddPolicy("ManageStore", new AuthorizationPolicyBuilder().RequiresClaim("Allowed").Build());
});
});
//To gracefully shutdown the server - Not for production scenarios