/// <summary> /// Constructor of class /// </summary> /// <param name="identity">Базовая реализация объекта <see cref="T:System.Security.Principal.IIdentity"/>, представляющего любого пользователя.</param> /// <param name="systemUser">Системный пользователь</param> /// <param name="sessionId">Identity of session</param> public UserPrincipal(IIdentity identity, SystemUser systemUser, Guid sessionId) : base(identity, new[] { systemUser.UserRole.Id.ToString() }) { SessionId = sessionId; SystemUser = systemUser; }
internal static UserPrincipal CreateVipPrincipal() { var systemUser = new SystemUser(); return new UserPrincipal(systemUser, new Guid(Constants.Roles.VipPrincipal)); }
/// <summary> /// Constructor of class /// </summary> /// <param name="systemUser">Системный пользователь</param> /// <param name="sessionId">Identity of session</param> public UserPrincipal(SystemUser systemUser, Guid sessionId) : this(new GenericIdentity(systemUser.Name), systemUser, sessionId) { }