On Oct 24, 9:48 pm, squ...@verizon.net wrote:
> Hello,
> I am am trying to come up with a way of securing controls inside of a
[quoted text clipped - 9 lines]
> manage this efficiently? Any help would be greatly appreciated.
> Thanks, J
Hi,
Typically the easiest way is to use Windows Integrated security. To
use this, set the Thread.ThreadPrincipal to a WindowsPrincipal. You
can create one for the currently logged on user via the
WindowsIdentity.GetCurrent method.
>From then on, your application can use the principal's IsInRole method
to see if the user is in a particular role, and hide access to forms
accordingly.
If you can't use integrated (domain) security for some reason, you can
create your own custom Principal and Identity classes, which can
authenticate against a database and load authorization roles from
there as well. This would be similar to asp.net, but there's not any
canned solutions in those regards.
HTH
Andy