public static Session Session(User user, params Role[] roles) { foreach (IRestriction r in roleRestrictionsRepository.LoadAll()) { if (!r.isValid(roles)) { return null; } } return new Session(user, roles); }
public Session(User user, Role[] roles) { this.user = user; this.roles = roles; this.sessionInitTime = DateTime.Now; }