Exemplo n.º 1
0
 public static bool CheckAccessByUser(SiteMapNode node, ThongTinCanBo user)
 {
     if (user != null)
     {
         if (node.Roles.Count == 0)
         {
             return(true);
         }
         for (int i = 0; i < node.Roles.Count; i++)
         {
             if (node.Roles[i] != null)
             {
                 string role = node.Roles[i].ToString();
                 return(MembershipExtension.CheckUserRole(role));
             }
         }
     }
     return(false);
 }
Exemplo n.º 2
0
 private static bool CheckAccess(HtmlHelper helper, SiteMapNode node, string appcode)
 {
     if (node.Roles.Count == 0)
     {
         return(true);
     }
     for (int i = 0; i < node.Roles.Count; i++)
     {
         if (node.Roles[i] != null)
         {
             string role = node.Roles[i].ToString();
             if (MembershipExtension.CheckUserRole(role))
             {
                 return(true);
             }
         }
     }
     return(false);
 }