示例#1
0
 /// <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;
 }
示例#2
0
文件: StubData.cs 项目: NecoMeco/Plan
 internal static UserPrincipal CreateVipPrincipal()
 {
     var systemUser = new SystemUser();
     return new UserPrincipal(systemUser, new Guid(Constants.Roles.VipPrincipal));
 }
示例#3
0
 /// <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)
 {
 }