From 753e22f87fe9971504c6198648966359a3305b55 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Wed, 28 Feb 2018 12:43:02 +0000 Subject: [PATCH] fixed #1997 --- src/Ombi/Controllers/IdentityController.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Ombi/Controllers/IdentityController.cs b/src/Ombi/Controllers/IdentityController.cs index 7c5730e0c..6a8aee52c 100644 --- a/src/Ombi/Controllers/IdentityController.cs +++ b/src/Ombi/Controllers/IdentityController.cs @@ -480,6 +480,8 @@ namespace Ombi.Controllers if (modifyingSelf && role.Equals(OmbiRoles.Admin)) { // We do not want to remove the admin role from yourself, this must be an accident + var claim = ui.Claims.FirstOrDefault(x => x.Value == OmbiRoles.Admin && x.Enabled); + ui.Claims.Remove(claim); continue; } await UserManager.RemoveFromRoleAsync(user, role);