473,396 Members | 1,923 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Custom roles based ASP.NET menu

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

Nov 11 '08 #1
4 6620
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! |
********************************************
"ne*****@noida.nospamhcltech.com"
<ne**************************@discussions.microsof t.comwrote in message
news:7C**********************************@microsof t.com...
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
Nov 13 '08 #2
Hi,

THanks for your response. Is there is any code related to 2nd approach you
suggested.

"Gregory A. Beamer" wrote:
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! |
********************************************
"ne*****@noida.nospamhcltech.com"
<ne**************************@discussions.microsof t.comwrote in message
news:7C**********************************@microsof t.com...
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
Nov 14 '08 #3
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/We...CountryCode=US

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

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

********************************************
| Think Outside the Box! |
********************************************
"ne*****@noida.nospamhcltech.com"
<ne**************************@discussions.microsof t.comwrote in message
news:7B**********************************@microsof t.com...
Hi,

THanks for your response. Is there is any code related to 2nd approach you
suggested.

"Gregory A. Beamer" wrote:
>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! |
********************************************
"ne*****@noida.nospamhcltech.com"
<ne**************************@discussions.microso ft.comwrote in message
news:7C**********************************@microso ft.com...
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
Nov 15 '08 #4
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

"Gregory A. Beamer" wrote:
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/We...CountryCode=US

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

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

********************************************
| Think Outside the Box! |
********************************************
"ne*****@noida.nospamhcltech.com"
<ne**************************@discussions.microsof t.comwrote in message
news:7B**********************************@microsof t.com...
Hi,

THanks for your response. Is there is any code related to 2nd approach you
suggested.

"Gregory A. Beamer" wrote:
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! |
********************************************
"ne*****@noida.nospamhcltech.com"
<ne**************************@discussions.microsof t.comwrote in message
news:7C**********************************@microsof t.com...
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


Nov 18 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: bala | last post by:
hi there is a custom built menu in an ms access 2000 applications (also xp application). all the command buttons or bars are going to be visible but i need to disable and able according the...
2
by: lucd | last post by:
Hello, I am currently playing with form authentication & role based security on a web application. As seen in the starter kit Time tracker, I setup a custom identity class (CustomPrincipal)...
3
by: charles | last post by:
Hi, I am trying to port my ASP application to ASP.Net 2.0 My application is sold to large corporations that have many thousands of users. So I do not use Forms authentication. To make it more...
1
by: Jakob Lithner | last post by:
When I started a new ASP project I was eager to use the login facilities offered in Framework 2.0/VS 2005. I wanted: - A custom principal that could hold my integer UserID from the database -...
1
by: needin4mation | last post by:
Hi, right now I have a classic ASP site that filters users based upon a MySQL database. The database was created with users and groups tables. Based upon the values in the database a user is...
0
by: Alex Brown | last post by:
Is it a problem to attach Non-static site map providers under one that inherits from StaticSiteMapProvider ? We are implementing a custom site map provider for a website that is being converted...
1
by: jesibl | last post by:
Hi All, I have an ASP .NET 2.0 web based app which should change content based on a variable passed in the query string. Let's say the variable is called ID and the variations are A, B and C. ...
1
by: Chicagoboy27 | last post by:
I have all the following site map ... <siteMapNode url="nothing.aspx" title="nothing" description="Home" roles=""> <siteMapNode url="default.asp" title="Home" description="Home" roles="" />...
0
by: sidhuasp | last post by:
Hi everyone I am using a mainmenu witeh sitemap provider with folowing sitemap <siteMapNode> <siteMapNode url="" title="Master Data" description="Enter Master data" roles ="Admin,PM"> ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.