From 8b5ae726c0057b84efbb2bbfb586088a0f697b00 Mon Sep 17 00:00:00 2001 From: Jamie Date: Tue, 28 Aug 2018 22:08:15 +0100 Subject: [PATCH] Add the music roles -.- !wip --- src/Ombi.Store/Context/OmbiContext.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Ombi.Store/Context/OmbiContext.cs b/src/Ombi.Store/Context/OmbiContext.cs index e93cc89ba..2fdbaa996 100644 --- a/src/Ombi.Store/Context/OmbiContext.cs +++ b/src/Ombi.Store/Context/OmbiContext.cs @@ -120,8 +120,8 @@ namespace Ombi.Store.Context Database.ExecuteSqlCommand("VACUUM;"); // Make sure we have the roles - var roles = Roles.Where(x => x.Name == OmbiRoles.ReceivesNewsletter); - if (!roles.Any()) + var newsletterRole = Roles.Where(x => x.Name == OmbiRoles.ReceivesNewsletter); + if (!newsletterRole.Any()) { Roles.Add(new IdentityRole(OmbiRoles.ReceivesNewsletter) { @@ -129,6 +129,19 @@ namespace Ombi.Store.Context }); SaveChanges(); } + var requestMusicRole = Roles.Where(x => x.Name == OmbiRoles.RequestMusic); + if (!requestMusicRole.Any()) + { + Roles.Add(new IdentityRole(OmbiRoles.RequestMusic) + { + NormalizedName = OmbiRoles.RequestMusic.ToUpper() + }); + Roles.Add(new IdentityRole(OmbiRoles.AutoApproveMusic) + { + NormalizedName = OmbiRoles.AutoApproveMusic.ToUpper() + }); + SaveChanges(); + } // Make sure we have the API User var apiUserExists = Users.Any(x => x.UserName.Equals("Api", StringComparison.CurrentCultureIgnoreCase));