In the application I'm developing, when the application starts users can
select between different menus (menus are stored in a database). Every user
has access only to specific menus. I store also in the database for every
menu, the role (group) that can access to this menu (this role is an AD
group), and when the user start the application, I want populate a list whit
the menus user can access (only menus whit a group within user is). To do
this, I need a list of groups a user belongs.
Has somebody a better approach to do the same?
Alex Bibiano
"Willy Denoyette [MVP]" <wi*************@pandora.be> escribió en el mensaje
news:u0**************@tk2msftngp13.phx.gbl...
Why do you need this, can't you simply use the IsInRole method to check
group membership?
Willy.
"Alex Bibiano" <ab******@informatica.com> wrote in message
news:Oj**************@TK2MSFTNGP11.phx.gbl...I use this code to get the current user in my Windows application:
AppDomain.CurrentDomain.SetPrincipalPolicy(Princip alPolicy.WindowsPrincipal);
WindowsIdentity wi = WindowsIdentity.GetCurrent();
Console.WriteLine(wi.Name);
now, I want get the windows groups this users belong. How can I do it?
If I have to search in the ActiveDirectory, how can I know if the user is
in an ActiveDirectory Domain and his path?
A lot of thanks