hi all,
The issue I've come across is that my sitemap needs to be a bit dynamic. For example, my website is accessed from another one and passes in via the query string a value which I use to determine the content on the site. For example, the variable in the query string might be ID and the values are A, B or C. I store the value in a session variable.
I have roles:
For A:
AdminA, UserA, ReadOnlyA
For B:
AdminB, UserB, ReadOnlyB
For C:
AdminC, UserC, ReadOnlyC
So if Joe is in UserC and accesses the page when Session["ID"] is B, Joe doesn't have access to the page.
So to authorise the user to particular sections of a page, I use the code:
Session["ID"] = Response.QueryString["ID"]
If (User.IsInRole("Admin" + Session["ID"].ToString())
{ //allow acess }
However, I can't do this with the sitemap because a sitemap requires you to enter the authorised roles at the beginning, but I don't know which "role" to allow access to until runtime, when the session variable is set.
Does this make sense?
So do I need to dynamically generate my sitemap at runtime?