pull/2020/head
tidusjar 7 years ago
parent c47cc7f8f2
commit 753e22f87f

@ -480,6 +480,8 @@ namespace Ombi.Controllers
if (modifyingSelf && role.Equals(OmbiRoles.Admin)) if (modifyingSelf && role.Equals(OmbiRoles.Admin))
{ {
// We do not want to remove the admin role from yourself, this must be an accident // 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; continue;
} }
await UserManager.RemoveFromRoleAsync(user, role); await UserManager.RemoveFromRoleAsync(user, role);

Loading…
Cancel
Save