I have modified UserRole entity with new properties. I need to validate user login and generate role based menu according to those properties.
public class ApplicationUserRole : IdentityUserRole { /// <summary> /// Initializes a new instance of the <see cref="ApplicationUserRole"/> class. /// </summary> public ApplicationUserRole() : base() { this.ValidFrom = DateTime.Now; this.ValidTo = DateTime.Now; } /// <summary> /// Gets or sets the valid from. /// </summary> /// <value>The valid from.</value> public virtual DateTime? ValidFrom { get; set; } /// <summary> /// Gets or sets the valid to. /// </summary> /// <value>The valid to.</value> public virtual DateTime? ValidTo { get; set; } }
if the login date not exists on the valid date range need to show user login expired message and if there is assigned multiple roles and expired one role need to hide those menu items on menu list.