FtpGetClientAccess Function  
 
BOOL WINAPI FtpGetClientAccess(
  HSERVER hServer,  
  UINT nClientId,  
  LPDWORD lpdwUserAccess  
);

Return the access rights that have been granted to the client session.

Parameters

hServer
The server handle.
nClientId
An unsigned integer which uniquely identifies the client session.
lpdwUserAccess
A pointer to an unsigned integer which specifies one or more access rights for the client session. For a list of user access rights that can be granted to the client, see User Access Constants. This parameter cannot be NULL.

Return Value

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

Remarks

The FtpGetClientAccess function is used to obtain all of the access rights that are currently granted to an authenticated client session. The FtpEnableClientAccess function can be used to enable or disable specific permissions, and the FtpSetClientAccess function can change multiple access rights at once.

Example

DWORD dwUserAccess = 0;

// Check if the client is a restricted user

if (FtpGetClientAccess(hServer, nClientId, &dwUserAccess))
{
    if (dwUserAccess & FTP_ACCESS_RESTRICTED)
    {
        _tprintf(_T("Client %u authenticated as a restricted user\n"), nClientId);
        return;
    }
}

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Import Library: csftsv10.lib

See Also

FtpAuthenticateClient, FtpEnableClientAccess, FtpSetClientAccess