aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

AspNetClaims updating a claim from a role

Open jvelezc opened this issue 10 years ago • 6 comments

The fact that an extension method is needed to remove claims in either the aspnetuserclaim and aspnetuserroleclaims is not the best way to interact with the system. It would be best if just like there is pseudo code RoleManager _roleManager = Exist today _roleManager.AddClaimAsync _roleManager.RemoveClaimAsync My proposal: There should also be UpdateClaimAsync

http://stackoverflow.com/questions/24587414/how-to-update-a-claim-in-asp-net-identity

Can I do a PR?

jvelezc avatar Apr 27 '16 20:04 jvelezc

@haok didn't we do this already? maybe only for user and not for role?

divega avatar May 04 '16 21:05 divega

Yeah someone added ReplaceClaim for UserManager, but we didn't add anything for role claims.

@jvelezc feel free to submit a PR

https://github.com/aspnet/Identity/blob/dev/src/Microsoft.AspNetCore.Identity/UserManager.cs#L978

HaoK avatar May 04 '16 21:05 HaoK

Bumping to post RTM

blowdart avatar May 18 '16 21:05 blowdart

Easy fix to make

HaoK avatar Jul 25 '16 18:07 HaoK

This is breaking change unfortunately as we need to add ReplaceClaim to IRoleClaimStore, its a fairly straightforward change, but needs to wait for now

HaoK avatar Oct 27 '16 21:10 HaoK

Noone has asked for this in 2 years, so closing

blowdart avatar Apr 17 '19 20:04 blowdart