CHttpServer::SetClientAccess Method  
 
BOOL SetClientAccess(
  UINT nClientId,  
  DWORD dwUserAccess  
);

Change the access rights associated with the specified client session.

Parameters

nClientId
An unsigned integer which uniquely identifies the client session.
dwUserAccess
An unsigned integer which specifies one or more user access rights. For a list of user access rights that can be granted to the client, see User and File Access Constants.

Return Value

If the method succeeds, the return value is non-zero. If the client ID does not specify a valid client session, the method will return zero. This method can only be used with authenticated clients. If the client session has not been authenticated, the return value will be zero.

Remarks

The SetClientAccess method can change multiple access rights for the client session. The EnableClientAccess method can be used to grant or revoke a specific permission for the client session.

If the dwUserAccess parameter has a value of HTTP_ACCESS_DEFAULT, then default permissions will be granted to the client session based on the configuration of the server. This is the recommended value for most clients. It is important to consider the implications of changing the access permissions granted to a client session. For example, if you do not grant clients HTTP_ACCESS_READ permission, it can effectively disable the site because the server will return 403 Forbidden errors for all GET and HEAD requests.

This function should typically be called in the OnConnect event handler to assign general permissions to the client, or in the OnCommand event handler after the client has issued a request and provided any authentication credentials that are required.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools11.h
Import Library: cshtsv11.lib

See Also

AuthenticateClient, EnableClientAccess, GetClientAccess