M
MSDN Account
We have web site that used the IIS ResKit tool MSWC.PermissionChecker to
check file permissions. The web site has been upgraded and that upgrade
included changing the default server side language from VBScript to C#
(*.vbs --> *.cs).
Does C# have a native method for doing what MSWC.PermissionChecker used to
do?
If so has anyone gone through converting the MSWC.PermissionChecker method
to C# and would they share what they did?
If not has anyone converted the MSWC.PermissionChecker vbs code to C# and
would they share what they did?
I have posted the old code (some wrapping did occur) hoping it may help you
help me. if more information is need just ask me.
Thanks!
Dan Rhoads
<head>
<%
'##### July 8, 2003 SEG, POPUP Window Based on /Groupmessages/default.htm
permissions
'##### Updated 02/19/2004 by Daniel W Rhoads, The Hartford, ISD Client
Engineering
'##### Fixed the window names so more than one popup can be opened at a time
'##### they were originally all set to 'newwindow'. Converted the popups
from standard
'##### IE windows to Modal Dialogs.
Dim objPC
Dim blnUserHasAccess
Set objPC = Server.CreateObject("MSWC.PermissionChecker")
'For each message you need to copy this code block. Edit the message number
and
'ensure the NFTS file permissions are correct for the file.
blnUserHasAccess = objPC.HasAccess("./GroupMessages/Message1.htm")
If blnUserHasAccess Then %>
<SCRIPT LANGUAGE="javascript">
var sFeatures="dialogHeight:425px; dialogWidth:400px; scroll:no;
status:no; help:no;";
//var sFeatures="dialogLeft:50px; dialogTop:50px; dialogHeight:425px;
dialogWidth:400px; scroll:no; status:no; help:no;";
window.showModalDialog("./groupmessages/Message1.htm", "", sFeatures);
</SCRIPT>
<% End If
blnUserHasAccess = objPC.HasAccess("./GroupMessages/Message2.htm")
If blnUserHasAccess Then %>
<SCRIPT LANGUAGE="javascript">
var sFeatures="dialogHeight:425px; dialogWidth:400px; scroll:no;
status:no; help:no;";
//var sFeatures="dialogLeft:150px; dialogTop:150px; dialogHeight:425px;
dialogWidth:400px; scroll:no; status:no; help:no;";
window.showModalDialog("./groupmessages/Message2.htm", "", sFeatures);
</SCRIPT>
<% End If %>
</head>
check file permissions. The web site has been upgraded and that upgrade
included changing the default server side language from VBScript to C#
(*.vbs --> *.cs).
Does C# have a native method for doing what MSWC.PermissionChecker used to
do?
If so has anyone gone through converting the MSWC.PermissionChecker method
to C# and would they share what they did?
If not has anyone converted the MSWC.PermissionChecker vbs code to C# and
would they share what they did?
I have posted the old code (some wrapping did occur) hoping it may help you
help me. if more information is need just ask me.
Thanks!
Dan Rhoads
<head>
<%
'##### July 8, 2003 SEG, POPUP Window Based on /Groupmessages/default.htm
permissions
'##### Updated 02/19/2004 by Daniel W Rhoads, The Hartford, ISD Client
Engineering
'##### Fixed the window names so more than one popup can be opened at a time
'##### they were originally all set to 'newwindow'. Converted the popups
from standard
'##### IE windows to Modal Dialogs.
Dim objPC
Dim blnUserHasAccess
Set objPC = Server.CreateObject("MSWC.PermissionChecker")
'For each message you need to copy this code block. Edit the message number
and
'ensure the NFTS file permissions are correct for the file.
blnUserHasAccess = objPC.HasAccess("./GroupMessages/Message1.htm")
If blnUserHasAccess Then %>
<SCRIPT LANGUAGE="javascript">
var sFeatures="dialogHeight:425px; dialogWidth:400px; scroll:no;
status:no; help:no;";
//var sFeatures="dialogLeft:50px; dialogTop:50px; dialogHeight:425px;
dialogWidth:400px; scroll:no; status:no; help:no;";
window.showModalDialog("./groupmessages/Message1.htm", "", sFeatures);
</SCRIPT>
<% End If
blnUserHasAccess = objPC.HasAccess("./GroupMessages/Message2.htm")
If blnUserHasAccess Then %>
<SCRIPT LANGUAGE="javascript">
var sFeatures="dialogHeight:425px; dialogWidth:400px; scroll:no;
status:no; help:no;";
//var sFeatures="dialogLeft:150px; dialogTop:150px; dialogHeight:425px;
dialogWidth:400px; scroll:no; status:no; help:no;";
window.showModalDialog("./groupmessages/Message2.htm", "", sFeatures);
</SCRIPT>
<% End If %>
</head>