ARCHITECTURE : Enabling and disabling functionality in ASP.NET based on roles.

J

Jason Nadrowski

VSK:

Google Groups was having trouble "retrieving" (Unable to retrieve
message (e-mail address removed)) your message so I
copied and pasted it below.

Here are my thoughts:
1. I would not be crazy about passing the Page object around. Can't
you simply pass the UserID of the person? That would be more
appropriate.
2. Depending on how complex your security logic was, I would consider
using Authorization manager (part of Windows 2003). There are some
previously recorded web casts
(http://www.microsoft.com/usa/webcasts/ondemand/) and some articles on
MSDN that talk about it. In a nut shell, you have all your security
logic embedded in Authorization manager and then you would simply pass
it the username and type of permission you are requesting. But, the
real beauty is that these security relationships are modified through
an MMC that an IT administrator can change at run time. Hence, very
flexible.

Take care,
Jason Nadrowski
http://www.informationhub.com
<a href="http://www.informationhub.com">Information Hub</a>


VSK ([email protected]) Wrote:
------------------------------------------------
Hi all,

In our ASP.NET web application we have to enable or disable features
in each
ASP.NET page based on role assigned to user.

Ex: if user who logs in is superisor then he can change phonenumber
in
page1.aspx
if user who logs in is finaceofficial then he can just view the
phone
number in page1.aspx

Thus Each page has elements whose functionality is enabled or disabled
based
on roles.

Iam trying to do this checks in a Single class for all page and am not
sure
whether it efficient.
My idea is to put code which checks the roles and enables and disabes
server
controls in one class for easier maintenence.Not sure as to whether
there is
any other alternative.

PS: am passing the entire Page object to the class :
objPageController.DeterminePageElements(this,"webform1");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top