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)); }
/// <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)); }