Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows 2000 user group and page security

Status
Not open for further replies.

adonet

MIS
May 4, 2004
312
US
I am going to code security for some page. Windows 2000 network administrator will create a group named it as TOPAGE and add about 20 users into it. My program will check the user login name and user group. If the user is in the TOPAGE group, program will open the page for the user otherwise will display "won't allow" message. The question is: how to get user's group name?
 
Imports System.Security.Principal

Public Function IsUserInRole(ByVal userRole As String) As Boolean

Dim user As New WindowsPrincipal(WindowsIdentity.GetCurrent())
If user.IsInRole(userRole) = True Then
Return True
End If

Return False

End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top