CFtpServer::GetClientAccess Method  
 
BOOL GetClientAccess(
  UINT nClientId,  
  DWORD& dwUserAccess  
);

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

Parameters

nClientId
An unsigned integer which uniquely identifies the client session.
dwUserAccess
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.

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 GetClientAccess method is used to obtain all of the access rights that are currently granted to an authenticated client session. The EnableClientAccess method can be used to enable or disable specific permissions, and the SetClientAccess method can change multiple access rights at once.

Example

DWORD dwUserAccess = 0;

// Check if the client is a restricted user
if (pFtpServer->GetClientAccess(nClientId, dwUserAccess))
{
    if (dwUserAccess & FTP_ACCESS_RESTRICTED)
    {
        std::cout << "Client authenticated as a restricted user\n";
        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

AuthenticateClient, EnableClientAccess, SetClientAccess