CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 4/9/2007 7:36:11 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 77 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
xoben
Asp.Net User
TreeView - Hide node based on Security Roles with Querystring URLS4/9/2007 7:36:11 PM

0/0

Hi,

I have Treeview with Sitemap and roles security enabled site configured properly.  What I am simply trying to do is hide one URL link node based on roles I am not worried about the security on this page I just need to hide the link.  From my research I understand siteMapNode?s that don?t have URL?s must have roles assigned for it to be visible I also understand that the roles attribute on the siteMapNode doesn't restrict visibility it widens it to allow the node to be shown to a user of a role.

 

 

----------TEST 1 -------------------------------------------------------------------------------------------------------------------------------------------------------

In the web.config I have tried to add Locations path (see example below) but because of the querystring information those special characters are not allowed within the web.config file.

--Example of my Web.SiteMap

<siteMapNode url="" title="Appetizers" description="" roles="Admin,Store User" >

<siteMapNode url="~/Products/Category.aspx?cax=8&#38;scax=19" title="Hors d'oeuvres" description="" />

<siteMapNode url="~/Products/Category.aspx?cax=8&#38;scax=41" title="Dips &#38; Sauces" description="" />

</siteMapNode>

 

--Example of my Web.Config

<siteMap defaultProvider="default" enabled="true">

<providers>

<add name="default" type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" siteMapFile="web.sitemap" securityTrimmingEnabled="true"/>

</providers>

</siteMap>

 


--placed just below </system.web>

<location path="~/Products/Category.aspx?cax=8&#38;scax=41">

      <system.web>

            <authorization>

                  <deny users="Store User"/>

            </authorization>

      </system.web>

</location>

 

 

----------TEST 2 -------------------------------------------------------------------------------------------------------------------------------------------------------

With test 2 I have added only the admin role to try and hide Dips & Sauces Category from ?Store Users? this test did not work.  If I had child nodes under ?Dips & Sauces? those nodes would not be visible for ?Store User?. 

--Example of my Web.SiteMap

<siteMapNode url="" title="Appetizers" description="" roles="Admin,Store User" >

<siteMapNode url="~/Products/Category.aspx?cax=8&#38;scax=19" title="Hors d'oeuvres" description="" roles="Admin,Store User" />

<siteMapNode url="~/Products/Category.aspx?cax=8&#38;scax=41" title="Dips &#38; Sauces" description="" roles="Admin" />

</siteMapNode>

 

 

In conclusion I think the problem resides with the querystring urls and I can?t think of any other ways to fix this problem except build my own custom Treeview menu.

Dave Sussman
Asp.Net User
Re: TreeView - Hide node based on Security Roles with Querystring URLS4/10/2007 10:24:26 AM

0/0

You're right in the assumption of query striongs - authorization only affects the base URL, not the query string. So site map entries that have the same base url all get the same authorization. The solution is not to write a treeview, but to write a custom site map provider, with custom authorization checking.

Read more on custom site maps in the provider toolkit (referenced from this blog post: http://weblogs.asp.net/scottgu/archive/2006/04/13/442772.aspx)

Dave

Bluetonic
Asp.Net User
Re: TreeView - Hide node based on Security Roles with Querystring URLS5/9/2007 11:04:01 AM

0/0

Did you manage to get around the problem with querystrings and roles?

 I'm experiencing the same problem...and don't want to duplicate .aspx pages for each of my querystrings Indifferent

3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008

Web:
Treeview with Sitemap hiding node based on roles - ASP.NET Forums Is it possible to hide the bolded node based on roles. ... You need to configure the SiteMapProvider to enable security trimming; then you need to .... that takes into account not only the URL, but also the query string. ...
TreeView Class (System.Web.UI.WebControls) If the number of characters in a URL of a node is larger than that number, ... Do not use the MaxDataBindDepth property to hide data. .... Walkthrough: Filtering Site-Map Nodes Based on Security Roles, Building ASP . ..... Add( NewNode) Next End If End Sub Function RunQuery(ByVal QueryString As String) As DataSet ...
TreeView Class (System.Web.UI.WebControls) Do not use the MaxDataBindDepth property to hide data. ... The URL to an image displayed for the collapsible node indicator. .... Walkthrough: Filtering Site- Map Nodes Based on Security Roles, Building ASP . .... Add(NewNode) Next End If End Sub Function RunQuery(ByVal QueryString As String) As DataSet ' Declare ...
VisualASP: Passing QueryString for oncontextmenu Function : visualasp QueryString and Node.URL are handling navigation well. ... 5, Hide the querystring in Solution - Treeview Site Navigation without ShowExpandCollapse Show quoteHide quote. > Hi. > > So does this open the url on the node as well as expand/collapse the > node when you click on it? ...
History node based file tree - friendlier (no) error when no write access ..... applied patch suppllied by Michele, url rewriter hides custom query strings ...
applied esteewy's patch: #5 ContentDetail.ToString() may throw ... new option to get children based on type - added a filter concept and some filters ... treeview links N2 0.27: - engine improvements - security/roles ...
Recipe: Implementing Role-Based Security with ASP.NET 2.0 using ... For example, pages that use site maps with security trimming enabled, and pages to which access is restricted using role-based URL directives in web.config, ...
CodeProject: Role-based Security with Forms Authentication. Free ... Sometimes it's better to show / hide content based on roles when you don't .... on a child node and after the content is loaded the tree view is geeting ...
Free favorite tree 1.0.2.0 Download - favorite tree 1.0.2.0 Script ... Node Tree handle expandable tree lists based on a hierachical array like Microsofts Explorer. ... Built-in role-based security support . ...




Search This Site:










security issue when migrating from asp.net 1.1 to asp.net 2.0

membershipstatus

bool networkcredential.authenticate("usera", "pass", "domainx.local");

requested registry access is not allowed.

simple security problem

virtual directory, iis.msc

login control with master page

email current page sends login screen

httpwebrequest and posting data

spoof email about asp net security

hi for problem login page

my ie6.0 will not save my windows login....

changing membershipprovider connection string?

windows authentication- only works locally

create user control

medium trust problem with sub applications

asp.net application and sql server why windows authentication?

suggestions on implementing multiple roles based on user departments

problem when a user logs in as two different users from same computer one after the other

writing a function to perform username / password validation

session timeout not working

membershipuser.isonline not work after running formsauthentication.signout()

decryption algorythm for md5 hash ??

form authentication - images/styles does not load on the login page!!

profile property collection

overriding authorization/authentication (forms) on 1 page

login control issue...

check if a user is logged on

problem with accepting (self-signed?) certificate

login control no regex

  Privacy | Contact Us
All Times Are GMT