12.7 PermissionChecker Component

The Permission Checker component interacts with Novell directory services (NDS) and the WebServer to determine whether a Web user has been granted access permissions by the administrator to a particular file in a Web Server.

You can use this component to customize the Novell script pages (NSP) -based page for different users. For example, if a Web page contains hyperlinks, you can use the permission checker component to test whether a user has permissions for the target Web pages. If the user does not have the required permissions, you can omit or alter the hyperlinks to target those pages the user may not access.

12.7.1 Object Diagram

Describes  the hierarchy of various objects in the Permission Checker component

Object Name

Properties

Methods

PermissionChecker Object

None.

HasAccess method

12.7.2 PermissionChecker Object

Interacts with NDS and the WebServer to determine whether a particular Web user has permissions to access a file in the WebServer.

12.7.3 HasAccess method

Checks whether a user has permission to access a specified file.

Syntax

 object.HasAccess(
   Filepath As String)
 

Parameters

FileURL
Specifies the relative or virtual path of the file.

Return Values

Boolean.

Remarks

If the file does not exists, the PermissionChecker object returns FALSE.

Example

This example gives access to the Department Policy Page to the member who has access rights, otherwise it returns "Sorry, you are not a member of this department".

 <% 
 Set pmck = CreateObject("MSWC.PermissionChecker") 
 UserHasAccess = pmck.HasAccess("/private/default.htm")
 If UserHasAccess 
 %>
 <A HREF="/Department/details.htm">The Department Policy Page</A>
 <% Else %>
   Sorry, you are not a member of this department.
 <% End If %>