zoukankan      html  css  js  c++  java
  • mojoportal学习笔记之显示所有菜单


      mojoportal默认不显示用户没有权限阅读的栏目的菜单

       项目需要,先显示所欲菜单,如果用户没有权限,点击后出现登陆页面。

       修改SiteMemu类

      注释掉如下代码
     //bool remove = false;

                
    //if (!(
                
    //        (isAdmin)
                
    //        || (
                
    //            (isContentAdmin) 
                
    //            && (mapNode.Roles != null)
                
    //            && (!(mapNode.Roles.Count == 1) 
                
    //            && (mapNode.Roles[0].ToString() == "Admins")
                
    //               )
                
    //            )
                
    //        || ((isContentAdmin) && (mapNode.Roles == null))
                
    //        || (
                
    //            (mapNode.Roles != null)
                
    //            &&(WebUser.IsInRoles(mapNode.Roles))
                
    //            )
                
    //    ))
                
    //{
                
    //    remove = true;
                
    //}

                
    //if (!mapNode.Settings.IncludeInMenu) remove = true;

                
    //if (remove)
                
    //{
                
    //    if (e.Item.Depth == 0)
                
    //    {
                
    //        menu.Items.Remove(e.Item);

                
    //    }
                
    //    else
                
    //    {
                
    //        MenuItem parent = e.Item.Parent;
                
    //        if (parent != null)
                
    //        {
                
    //            parent.ChildItems.Remove(e.Item);
                
    //        }
                
    //    }
                
    //}
  • 相关阅读:
    装饰模式(Decorator Pattern)
    适配器模式(Adapter Pattern)
    组合模式
    单例的两种模式
    抽象工厂模式(Abstract Factory Pattern)
    工厂方法模式
    桥接模式
    原型模式(Prototype Pattern)
    建造者模式(Builder Pattern)
    解决使用tomcat服务器发布web项目时出现URL中文乱码的问题
  • 原文地址:https://www.cnblogs.com/wenjie/p/1169274.html
Copyright © 2011-2022 走看看