Nov 20, 2010, 6:06 PM
updating of pages
Tell please why after updating of pages (in the browser), management elements vanish?
Doing debugging, a part because of what bugs,
Business in Global.asax in a method protected void Application_AuthorizeRequest (Object sender, EventArgs e),
Prompt what not so
Doing debugging, a part because of what bugs,
Business in Global.asax in a method protected void Application_AuthorizeRequest (Object sender, EventArgs e),
Prompt what not so
protected void Application_AuthorizeRequest(Object sender, EventArgs e)
{
if (Request.IsAuthenticated) //проверяем пользователь выполнил утентификацию
{
//если запрашиваеться эти страницы то не проверять роли
string pageName = Request.FilePath.Remove(0, 1);
if ((pageName == "Login.aspx") || (pageName == "AccessDenied.aspx"))
return;
System.Data.DataView pages = (System.Data.DataView)Context.Cache["CachePages"];
if ((pages == null) || (pages.Count == 0))
{
classLogic._pages page = new classLogic._pages();
pages = page.List();
Context.Cache.Insert("CachePages", pages, null, DateTime.Now.AddHours(1), TimeSpan.Zero);
}
pages.RowFilter = "PagesName = '" + pageName + "'";
if (pages.Count > 0)
{
foreach (string role in pages[0]["PagesGroupList"].ToString().Split(new char[] { ',' }))
{
if (Context.User.IsInRole(role))
{
return;
}
}
}
Context.RewritePath("AccessDenied.aspx");
}
}
Last edited by Daimon; Nov 20, 2010 at 6:36 PM.