<% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp335e.asp&srcfile=Components/PermissionCheck" %> Permission Checker

Permission Checker

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.

This example demonstrates the use of the PermissionChecker object, provided by the Permission Checker component, and the sole method provided through that object, HasAccess. 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. HasAccess can take as a parameter either a virtual path or a physical path.

For this example, an instance of the object is created, and the variable Check is set to refer to that new instance. Check is then used to access HasAccess.

Note This component is not installed with IIS. You can install it from the Microsoft Web site at http://www.microsoft.com/iis/, 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 Server.CreateObject invocation in this sample script must be modified to reflect the proper component ProgID.


© 1997 by Microsoft Corporation. All rights reserved.