|
-
December 17th, 2002, 10:55 PM
#1
Is there an IsInGroup Function
I would like to check if a user on an ASP.net web form is in a particular group.
I have Forms authentication turned on and need to check programitacilly if a user is in a group or not to allow access to various fnctions.
There is a User.IsInRole function but I always get false for just the Group Name or Domain/Group Name.
Is a Role different to a Group?
Any samples around like this?
Also, is there a way to identify all the groups in a domain via WMI or something?
Thank you
David
-
December 18th, 2002, 04:25 PM
#2
RE: IsInRole
User.IsInRole exists in web forms and can be used as
User.IsInRole("Domain\Group")
However, if the Group is predefined by Windows then you need to use
BUILTIN\Group
I have seen code that actually checks security like
Dim wp As New System.Security.Principal.WindowsPrincipal(CType(User.Identity, System.Security.Principal.WindowsIdentity))
wp.IsInRole("Domain\Group")
But I do not know why the difference.
I still can not find out how to get the list of groups on a network.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|