2010 sitemap
-
I would like to know how to modify a sitemap and/or change some C# 2010 code to not allow certain users access to this new web page. I am basically adding a new web form page to an existing C#.net 2010 application. I am adding some web pages that will be displayed from the main page. Right now the contractor that setup this application, had 'shells' for the modules that will be added at different points. When the existing web page displays that I am going to add to this website, the page is pointed to a 'mapped url' that displays 'the site is under construction'. In the web.config file, there is a sitemap that says who access the web page. I tried to give the sitemap a user role that does not exist in the active directory and the web page still displayed. Thus can you tell me and/or point me to a reference on how to modify the sitemap and/or add some code to the application so only users under a certain role have access this this new web page?
-
I would like to know how to modify a sitemap and/or change some C# 2010 code to not allow certain users access to this new web page. I am basically adding a new web form page to an existing C#.net 2010 application. I am adding some web pages that will be displayed from the main page. Right now the contractor that setup this application, had 'shells' for the modules that will be added at different points. When the existing web page displays that I am going to add to this website, the page is pointed to a 'mapped url' that displays 'the site is under construction'. In the web.config file, there is a sitemap that says who access the web page. I tried to give the sitemap a user role that does not exist in the active directory and the web page still displayed. Thus can you tell me and/or point me to a reference on how to modify the sitemap and/or add some code to the application so only users under a certain role have access this this new web page?
To the best of my knowledge, the sitemap.xml is just a xml file that contains sitemap nodes. You can't control access to files and folders through it. You have to write code for each page, to control access. So let's say you have 5 levels of security
On login, you would add
Context.Session.Add("security", 5)And in the page, on page.init, your code would say
If Not Context.Session("security") > 3 Then
Context.response.redirect("security.aspx")
End If -
To the best of my knowledge, the sitemap.xml is just a xml file that contains sitemap nodes. You can't control access to files and folders through it. You have to write code for each page, to control access. So let's say you have 5 levels of security
On login, you would add
Context.Session.Add("security", 5)And in the page, on page.init, your code would say
If Not Context.Session("security") > 3 Then
Context.response.redirect("security.aspx")
End IfI agree with this. You cannot control security using xml but you can check variables and then redirect accordingly. Another option would be to use a database and check the users security level and that will determine what pages they can view.
Kind Regards Julian Mummery