ensures the front office group existence

This commit is contained in:
2016-09-05 00:26:12 +02:00
parent 81925e3787
commit 0bbcb749a7

View File

@ -34,7 +34,6 @@ namespace Yavsc
public static string ConnectionString { get; private set; }
public static string Authority { get; private set; }
public static string Audience { get; private set; }
private static ILogger logger;
public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv)
{
@ -131,11 +130,8 @@ namespace Yavsc
.AddDbContext<ApplicationDbContext>(options => options.UseNpgsql(ConnectionString))
;
ConfigureOAuthServices(services);
services.AddCors(
/*
options =>
@ -203,11 +199,9 @@ namespace Yavsc
options.ResourcesPath = "Resources";
}).AddDataAnnotationsLocalization();
services.AddScoped<LanguageActionFilter>();
// Inject ticket formatting
// Inject ticket formatting
services.AddTransient(typeof(ISecureDataFormat<>), typeof(SecureDataFormat<>));
services.AddTransient<Microsoft.AspNet.Authentication.ISecureDataFormat<AuthenticationTicket>, Microsoft.AspNet.Authentication.SecureDataFormat<AuthenticationTicket>>();
services.AddTransient<ISecureDataFormat<AuthenticationTicket>, TicketDataFormat>();
@ -282,6 +276,7 @@ namespace Yavsc
Task.Run(async ()=>{
foreach (string roleName in new string[] {Constants.AdminGroupName,
Constants.StarGroupName, Constants.PerformerGroupName,
Constants.FrontOfficeGroupName,
Constants.StarHunterGroupName
})
if (!await _roleManager.RoleExistsAsync(roleName))