示例#1
0
        public static void SetCurrentPrincipal(KmsPrincipal principal)
        {
            Thread.CurrentPrincipal = principal;

            if (HttpContext.Current != null)
            {
                HttpContext.Current.User = principal;
            }
        }
示例#2
0
 /// <summary>
 ///     Devuelve el objeto de Identidad que ostenta el Principal del Thread actual.
 /// </summary>
 public static KmsIdentity GetCurrentPrincipalIdentity()
 {
     return(KmsPrincipal.CurrentPrincipal().Identity as KmsIdentity);
 }
示例#3
0
 public void SetAsCurrent()
 {
     KmsPrincipal.SetCurrentPrincipal(this);
 }