Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Disable / Enable Roles #10316


User avatar
0
murat.yuceer created

Hi,

We need to disable Roles without remove from user. This can be done temporarily, then activated.

How can we achieve this?


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @murat.yuceer

    What will be the difference from remving a role from user and adding the role back ? Do you want to handle this automatically ? For example disalbe a role from user until a date ?

  • User Avatar
    0
    murat.yuceer created

    Yes, actually TSE want it from us. They dont want to lost role information from user. For a certain period of time they want to disable

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @murat.yuceer

    Sorry for the late reply. In that case, you can create a new table to keep role disable dates (RoleId, StartDate, EndDate) and exclude roles by overriding UserRoleStore's GetRolesAsync method.

  • User Avatar
    0
    murat.yuceer created

    Thank you