mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
New role to enable users to remove their own requests
This commit is contained in:
parent
5e0f04a2f6
commit
0b2b3d2f30
7 changed files with 31 additions and 5 deletions
|
@ -145,6 +145,16 @@ namespace Ombi.Store.Context
|
|||
SaveChanges();
|
||||
}
|
||||
|
||||
var manageOwnRequestsRole = Roles.Where(x => x.Name == OmbiRoles.ManageOwnRequests);
|
||||
if (!manageOwnRequestsRole.Any())
|
||||
{
|
||||
Roles.Add(new IdentityRole(OmbiRoles.ManageOwnRequests)
|
||||
{
|
||||
NormalizedName = OmbiRoles.ManageOwnRequests.ToUpper()
|
||||
});
|
||||
SaveChanges();
|
||||
}
|
||||
|
||||
// Make sure we have the API User
|
||||
var apiUserExists = Users.Any(x => x.UserName.Equals("Api", StringComparison.CurrentCultureIgnoreCase));
|
||||
if (!apiUserExists)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue