home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_06.cab / samp335e.asp < prev    next >
Text File  |  1997-10-23  |  3KB  |  42 lines

  1.  <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp335e.asp&srcfile=Components/PermissionCheck" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  3. <HTML>
  4. <HEAD>
  5. <META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
  6. <title>Permission Checker</title>
  7. <script language="JavaScript">
  8.  
  9.     szNavVersion = navigator.appVersion
  10.  
  11.     if (navigator.appName == "Microsoft Internet Explorer") {
  12.     if (szNavVersion.indexOf ("4.") >= 0) {
  13.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  14.     } else {
  15.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  16.     }
  17.     }
  18.     else if (navigator.appName == "Netscape") {
  19.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  20.     }
  21.     else {
  22.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  23.     }
  24.  
  25. </script>
  26. <META NAME="DESCRIPTION" CONTENT="Internet Information Server reference information"></HEAD>
  27. <BODY BGCOLOR=#FFFFFF TEXT=#000000>
  28. <font face="Verdana, Arial, Helvetica">
  29. <h3><a name="_permission_checker"></a>Permission Checker</h3>
  30. <p>
  31. The Permission Checker component provides you with an interface to the authentication and permissions services provided by IIS and Windows NT®. You can use this component to easily determine whether a client browser has read-access to a particular file.</p>
  32. <p>
  33. This example demonstrates the use of the <b>PermissionChecker</b> object, provided by the Permission Checker component, and the sole method provided through that object, <b>HasAccess</b>. This method returns True if the current client browser is granted read access to the specified file, and returns False if the browser is denied access, or if the file doesn't exist. <b>HasAccess</b> can take as a parameter either a virtual path or a physical path. </p>
  34. <p>
  35. For this example, an instance of the object is created, and the variable <i>Check</i> is set to refer to that new instance. <i>Check</i> is then used to access <b>HasAccess</b>. </p>
  36. <p>
  37. <b>Note</b>  This component is not installed with IIS. You can install it from the Microsoft Web site at <a href="http://www.microsoft.com/iis/"><b>http://www.microsoft.com/iis/</b></a>, or from the CD included with the IIS Resource Kit. The ProgID declared by the component version installed from these sources specifies "IISSamples" in the vendor component of the ProgID, not "MSWC." Therefore, the <b>Server.CreateObject</b> invocation in this sample script must be modified to reflect the proper component ProgID.</p>
  38. <hr class="iis" size="1">
  39. <p align="center"><em><a href="/iishelp/common/colegal.htm">© 1997 by Microsoft Corporation. All rights reserved.</a></em></p>
  40. </BODY>
  41. </HTML>
  42.