Hi, im new to this (well xlst) and need to manipulate an xml document. im using the aspnetmenu control and now wish to dynamically build the menu from a list of user access rights.
here is my MENU xml below (a cut down version)
<MenuData ImagesBaseURL="/img/">
<MenuGroup CssClass="TopGroup">
<MenuItem Label="System" IsVisible="false" URL="/system.aspx" ID="system">
<MenuGroup ID="g_System">
<MenuItem Label="Stock" IsVisible="false" URL="/stock.aspx" ID="stock">
<MenuGroup>
<MenuItem Label="Frames" IsVisible="false" URL="/frames.aspx" ID="st_fr" />
<MenuItem Label="Lenses" IsVisible="false" URL="/lenses.aspx" ID="st_le" />
</MenuGroup>
</MenuItem>
<MenuItem Label="Reports" IsVisible="false" URL="/topReports.aspx" ID="reports" >
<MenuGroup>
<MenuItem Label="Customer" IsVisible="false" URL="/customer.aspx" ID="re_cu" />
<MenuItem Label="Appointments" IsVisible="false" URL="/apps.aspx" ID="re_ap" />
</MenuGroup>
</MenuItem>
</MenuGroup>
</MenuItem>
</MenuGroup>
</MenuData>
hers is my ACCESSRIGHTS xml from the backend call
<accessrights>
<user id="001">
<right>system</right>
<right>stock</right>
<right>st_fr</right>
<right>reports</right>
<right>re_ap</right>
</user>
</accessrights>
what i wish to do is from the ACCESSRIGHTS xml i wish to cycle through the MENU xml and where a matching "ID" is found i wish to change the IsVisible attribute to true, thus enabling the menu item, if no access rights are found for a specific item then the menu item obviously remains invisible.in this little example i have added here the menu would all be enabled apart from the 2 options (customer under reports, and Lenses under stock)
many thanks and i hope is it clear enough to work from
steve
Start Free Trial