Custom roles based ASP.NET menu

  • Thread starter Thread starter neerajb
  • Start date Start date
N

neerajb

Hi, I have a question with respect to the security implementation of Menu
using sitemap. Normally in the sitemap we can implement role based security
but that is based on the Role based functionality provided by ASP.NET.
Actually in our site we are using custom roles with our own role management
and stuff. So is there a way to hide or show certain elements of the Sitemap
in my menu based on the custom roles without using asp.net roles
 
I see two ways to tackle this (three if you include build everything from
scratch).

1. Alter your role management to inherit from the Microsoft Role Management
bits. This is the simplest, as long as it does not completely tear up your
model. You then have to hook in the MS events to your role management and
you are done.

2. Implement a custom site map provider and override the security trimmings
behavior. This may be easy (have not looked), but I would imagine it is a
bear, as I have seen little blogged about it.

--
Gregory A. Beamer
MVP: MCP: +I, SE, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think Outside the Box! |
********************************************
"(e-mail address removed)"
 
Hi,

THanks for your response. Is there is any code related to 2nd approach you
suggested.
 
MSDN has this:
http://msdn.microsoft.com/en-us/library/aa479320.aspx

It has some examples, but is a bit dry. Prosise wrote an article, but it is
not really deep:
http://msdn.microsoft.com/en-us/magazine/cc163787.aspx

If you are more "visual" try this (watch wrapping):
http://msevents.microsoft.com/cui/W...lture=en-US&EventID=1032286079&CountryCode=US

--
Gregory A. Beamer
MVP: MCP: +I, SE, SD, DBA

Blog:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think Outside the Box! |
********************************************
"(e-mail address removed)"
 
Thanks Gregory for the quick response.

I went through the msdn article but still not able to understand htat how my
application will come to know about the logged in User role as i ma using the
roles defined in database .

Please help.
Neeraj
 
Back
Top