I am implementing role-based authentication using ASP.NET Identity. I have issue with assign roles
Hello guys, I am implementing role-based authentication using ASP.NET Identity. I have already added three roles: Member, Admin (can create resources), and Owner (can assign roles, grant or revoke the Admin role). I want to keep my controllers clean and move the logic to the infrastructure layer, but something feels wrong. I can't write proper code to prevent the Owner from demoting themselves. Any ideas?
3 Replies
owner would be able to remove permissions from himself, but also to add them back
if owner removes own permissions there is no owner anymore
not exactly, owner still can assign those permission to himself