It doesn't make any sense to show a link that doesn't work; show it only if the user can go there.
Here's a neat VBScript that uses LDAP to determine group membership of the logged-in user. You can replace the sUserID value with the HTTP.AUTH_USER info (I assume that your Web server is running under authentication; if not, you're hosed). From there, compare to a list of groups that have access to the server, and display ONLY the links for which the user has access.
'************************************************************
'INGROUP function
'
' Thanks in part to Microsoft's site, and to Richard Mueller
'
' This function simply returns the groups that a particular
' user, regardless of OU membership belongs. Function can
' be modified to build an array, and to check whether or
' not the function has already run once in the script. If
' it has the query to AD can be avoided a second time around.
'
'*************************************************************
'Create connection and command object
Set con = CreateObject("ADODB.Connection")
Set com = CreateObject("ADODB.Command")
'Opening the connection
con.Provider = "ADsDSOObject" 'this is the ADSI OLE-DB provider name
con.Open "Active Directory Provider"
'Create a command object for this connection
Set Com.ActiveConnection = con
'Get DC
Set oRoot = GetObject("LDAP://RootDSE")
dcString = oRoot.Get("DefaultNamingContext")
'Get current user (Assuming Windows NT/Windows 2000 Only!)
Set oNet = CreateObject("Wscript.Network")
sUserID = oNet.UserName
'Compose a search string
sQuery = "SELECT distinguishedName from 'LDAP://" & dcString
sQuery = SQuery & "' WHERE sAMAccountName = '" & sUserID & "'"
com.CommandText = sQuery
'Execute the query
Set rs = Com.Execute
'Populate the relative path
ouString = rs.Fields("distinguishedName")
WScript.Echo "** Displaying Groups **"
Set oUser = GetObject("LDAP://" & ouString)
' Here is where you can populate a "Groups" array and flag to not query
' AD again.
' But this function just displays the groups, SANS the "DC="
For Each oGroup In oUser.Groups
WScript.Echo Right(oGroup.Name,Len(oGroup.Name)-3)
Next
'Housecleaning
Set oNet = Nothing
Set oRoot = Nothing
Set rs = Nothing
Set oGroup = Nothing
Set oUser = Nothing
'*********************************************
Have Fun!
Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
I'll have the roast duck with the mango salsa.