Пример #1
0
        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);
        }
Пример #2
0
 public Session(User user, Role[] roles)
 {
     this.user = user;
     this.roles = roles;
     this.sessionInitTime = DateTime.Now;
 }