HighTechTalks DotNet Forums  

role based security to enable controls

Dotnet Security microsoft.public.dotnet.security


Discuss role based security to enable controls in the Dotnet Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Kevin Meiresonne
 
Posts: n/a

Default role based security to enable controls - 02-25-2005 , 05:17 AM






I would like to know how i can easily use role based authentication to
enable or disable certain controls (e.g. buttons) in a windows .NET
application.

Anyone suggestions?



Reply With Quote
  #2  
Old   
richlm
 
Posts: n/a

Default Re: role based security to enable controls - 02-25-2005 , 05:46 PM






One approach is to perform a role-based security check in the
"VisibleChanged" event (or override "OnVisibleChanged" if appropriate).
You can then set the Enabled property appropriately.
In your Form_Load event you could iterate the Controls on the form and
attach the event handler.

You can assign roles to controls declaratively in code with a custom
attribute, and then use reflection in the event handler code to get the
attribute.



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.