Пример #1
0
 public bool IsInRole(string role)
 {
     if (!OriginPrincipal.Identity.IsAuthenticated)
     {
         return(false);
     }
     if (Resolve == null)
     {
         return(OriginPrincipal.IsInRole(role));
     }
     if (!InitRoleEntity())
     {
         return(false);
     }
     return(RoleEntity.IsInRole(role));
 }
Пример #2
0
 /// <summary>
 /// Determines whether the current principal belongs to the specified role.
 /// </summary>
 /// <param name="role">Role.</param>
 /// <returns></returns>
 public bool IsInRole(string role)
 {
     if (!OriginPrincipal.Identity.IsAuthenticated)
     {
         return(false);
     }
     if (Resolver == null)
     {
         if (OriginPrincipal == this)
         {
             return(false);
         }
         else
         {
             return(OriginPrincipal.IsInRole(role));
         }
     }
     if (RoleEntity == null)
     {
         return(false);
     }
     return(RoleEntity.IsInRole(role));
 }