//判断权限 private void JudgmentAuthority(string userId) { List <int> UserRights = new UserRightsHandler().GetRigtsCodeByUserId(userId.ToString()); if (!UserRights.Contains(1)) { Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('改用户无此权限,请重新登陆!');</script>"); Session["admin"] = null; Response.Redirect("weiyena2017.aspx"); } if (UserRights.Contains(2)) { UserManagerPag.Style.Add("display", "inline"); } else { UserManagerPag.Style.Add("display", "none"); } if (UserRights.Contains(3)) { UrlManagerPag.Style.Add("display", "inline"); } else { UrlManagerPag.Style.Add("display", "none"); } if (UserRights.Contains(4)) { UpdateIntrodutionPad.Style.Add("display", "inline"); } else { UpdateIntrodutionPad.Style.Add("display", "none"); } }
private void JudgmentAuthority(string userId) { List <int> UserRights = new UserRightsHandler().GetRigtsCodeByUserId(userId.ToString()); if (!UserRights.Contains(1)) { Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('改用户无此权限,请重新登陆!');</script>"); Session["admin"] = null; Response.Redirect("weiyena2017.aspx"); } }
//判断权限 private void JudgmentAuthority(string userId) { List <int> UserRights = new UserRightsHandler().GetRigtsCodeByUserId(userId.ToString()); if (UserRights.Contains(1)) { NewsManagerPag.Style.Add("display", "inline"); } else { NewsManagerPag.Style.Add("display", "none"); } if (UserRights.Contains(2)) { UserManagerPag.Style.Add("display", "inline"); } else { UserManagerPag.Style.Add("display", "none"); } if (UserRights.Contains(3)) { UrlManagerPag.Style.Add("display", "inline"); } else { UrlManagerPag.Style.Add("display", "none"); } if (UserRights.Contains(4)) { UpdateIntrodutionPad.Style.Add("display", "inline"); } else { UpdateIntrodutionPad.Style.Add("display", "none"); } }