Exemplo n.º 1
0
        /// <summary>
        /// 检测用户页面访问权限
        /// </summary>
        protected void CheckPageAuthorization()
        {
            //获取页面Code
            CPathBar pathBar = (CPathBar)Page.FindControl("pathBar");

            if (pathBar == null)
            {
                Response.Write("<script> top.location.href='" + Helper.GetAppSettings("NoAuthorizationPageUrl") + "';</script>");
                return;
            }
            string Ptype = pathBar.PageType.ToString().ToLower();

            if (Ptype == "normal" || Ptype == "referer")//不验证权限
            {
                return;
            }

            if (WebCache.Get("RoleInfo_BackWeb_" + LoginedUser.UserID) != null)
            {
                LoginedUser = (LoginedUserEntity)WebCache.Get("RoleInfo_BackWeb_" + LoginedUser.UserID);
                //获取一级菜单
                if (LoginedUser.Permission.Rows.Count == 0)
                {
                    Response.Write("<script> top.location.href='" + Helper.GetAppSettings("NoAuthorizationPageUrl") + "';</script>");
                    return;
                }
            }
        }
Exemplo n.º 2
0
 protected override void OnInit(EventArgs e)
 {
     if (Request["id"] != null)
     {
         CPathBar pathBar = (CPathBar)Page.FindControl("pathBar");
         //pathBar.PageType =CommunityBuy.WebControl.CPathBar.PType.Edit;
     }
     base.OnInit(e);
     if (!this.DesignMode)
     {
     }
 }