mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-31 12:00:06 -07:00
Add the music roles -.- !wip
This commit is contained in:
parent
0ff920fdb3
commit
8b5ae726c0
1 changed files with 15 additions and 2 deletions
|
@ -120,8 +120,8 @@ namespace Ombi.Store.Context
|
||||||
Database.ExecuteSqlCommand("VACUUM;");
|
Database.ExecuteSqlCommand("VACUUM;");
|
||||||
|
|
||||||
// Make sure we have the roles
|
// Make sure we have the roles
|
||||||
var roles = Roles.Where(x => x.Name == OmbiRoles.ReceivesNewsletter);
|
var newsletterRole = Roles.Where(x => x.Name == OmbiRoles.ReceivesNewsletter);
|
||||||
if (!roles.Any())
|
if (!newsletterRole.Any())
|
||||||
{
|
{
|
||||||
Roles.Add(new IdentityRole(OmbiRoles.ReceivesNewsletter)
|
Roles.Add(new IdentityRole(OmbiRoles.ReceivesNewsletter)
|
||||||
{
|
{
|
||||||
|
@ -129,6 +129,19 @@ namespace Ombi.Store.Context
|
||||||
});
|
});
|
||||||
SaveChanges();
|
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
|
// Make sure we have the API User
|
||||||
var apiUserExists = Users.Any(x => x.UserName.Equals("Api", StringComparison.CurrentCultureIgnoreCase));
|
var apiUserExists = Users.Any(x => x.UserName.Equals("Api", StringComparison.CurrentCultureIgnoreCase));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue