The NetAccessCheck API verifies that a user has the proper access permission for a particular resource.
Restrictions
This API can be called from OS/2 servers. OS/2 workstations can issue this call locally only if the Peer service is started.
Directory and Security Server Only
This API returns an ERROR_ACCESS_DENIED if the user is not logged on.
A redirected drive should not be specified for pszResource. If a redirected drive is specified, a NERR_ResourceNotFound error code is returned.
#include <netcons.h> #include <access.h> NetAccessCheck(reserved, pszUserID, pszResource, AccessPermission, pResult); /* 16 bit */ Net32AccessCheck(reserved, pszUserID, pszResource, AccessPermission, pResult); /* 32 bit */Parameters
See Common Parameter Definitions for descriptions of parameters not defined here.
reserved
The following table lists the return codes most significant to this API.
See API Return Codes for a complete
list of return codes. ┌─────────────────────────┬───────┬────────────────────────────────────────────┐│SYMBOLICCONSTANT
│VALUE│MEANING │
├─────────────────────────┼───────┼────────────────────────────────────────────┤
│ NERR_Success │ 0 │ No errors were encountered. │
├─────────────────────────┼───────┼────────────────────────────────────────────┤
│ ERROR_ACCESS_DENIED │ 5 │ Administrator privilege is required. │
├─────────────────────────┼───────┼────────────────────────────────────────────┤
│ ERROR_NOT_SUPPORTED │ 50 │ This request is not supported by the
│
│ │ │ network. │
├─────────────────────────┼───────┼────────────────────────────────────────────┤
│ ERROR_INVALID_PARAMETER │ 87 │ At least one parameter value is not valid.
│
├─────────────────────────┼───────┼────────────────────────────────────────────┤
│ NERR_ServerNotStarted │ 2114 │ The Server service has not been started.
│
├─────────────────────────┼───────┼────────────────────────────────────────────┤
│ NERR_InternalError │ 2140 │ An internal error has occurred. │
├─────────────────────────┼───────┼────────────────────────────────────────────┤
│ NERR_InvalidAPI │ 2142 │ The requested API is not supported on the
│
│ │ │ remote server. │
├─────────────────────────┼───────┼────────────────────────────────────────────┤
│ NERR_ACFNotFound │ 2219 │ The NET.ACC file is missing. │
├─────────────────────────┼───────┼────────────────────────────────────────────┤
│ NERR_UserNotFound │ 2221 │ The user name
cannot be found. │
├─────────────────────────┼───────┼────────────────────────────────────────────┤
│ NERR_ResourceNotFound │ 2222 │ The netname cannot be found. │
├─────────────────────────┼───────┼────────────────────────────────────────────┤
│ NERR_ACFNotLoaded │ 2227 │ The UAS database has not been started.
│
├─────────────────────────┼───────┼────────────────────────────────────────────┤
│ NERR_ACFFileIOFail │ 2229 │ An error was encountered in accessing
the │
│ │ │ accounts database. │
├─────────────────────────┼───────┼────────────────────────────────────────────┤
│ NERR_InvalidDatabase │ 2247 │ The UAS database file is damaged.
│
└─────────────────────────┴───────┴────────────────────────────────────────────┘
Other codes could be returned from the following functions:
If an access permission record cannot be found for the specified user name and the specified resource, the NetAccessCheck API tries to find the proper access permission record for the GUEST account, a special account set up for temporary users of the resource. GUEST accounts are defined in the IBMLAN.INI file.
For information about: