private static bool IsValid(UserAccess userAccess) { IdentityToken token = userAccess != null ? userAccess.Token : null; return(token != null && !token.IsExpired); }
/// <summary> /// Initializes a new instance of the <see cref="UserAccess"/> class /// with the specified token, user, and service catalog. /// </summary> /// <param name="token">The <see cref="IdentityToken "/>.</param> /// <param name="user">The <see cref="UserDetails"/>.</param> /// <param name="serviceCatalog">List of <see cref="ServiceCatalog"/>s.</param> public UserAccess(IdentityToken token, UserDetails user, ServiceCatalog[] serviceCatalog) { Token = token; User = user; ServiceCatalog = serviceCatalog; }