how to assign a role to user for Specified time, asp.net mvc5, Identity 2.0

32 Views Asked by At

how to assign a role to user for Specified time (for example 10 day) using asp.net mvc5, Identity 2.0

I think we can do it by adding an expiration field to AspNetUsersRoles table like below, but I dont know how?

AspNetUsersRoles

1

There are 1 best solutions below

0
clement On

I would keep Identity intact and use antoher table to store that (Extension Table). With that, the additionnal table would store FK_UserRole and a Date.

Then you can check the date of the person on each conneciton of this person and remove the role if neccessary.