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. |