get_items_access
To learn what access rights a user currently has to objects, use the user/get_items_access method.
svc=user/get_items_access¶ms={
"userId": <long>,
"directAccess": <bool>,
"itemSuperclass": "<text>",
"flags": <uint>
}
Parameters
The required parameters are marked with an asterisk (*).
| Parameter | Description |
|---|---|
userId* |
User ID. |
directAccess* |
Return only the objects to which the user has direct access rights. |
itemSuperclass* |
Object type. For the list of types, see Item types. |
flags |
Flags. Return: 0x1 for combined access level, 0x2 for direct access level. The flags are used only if directAccess is false (see Response). |
Response
The response contains only the objects to which the current user also has access. The response format depends on the directAccess and flags parameters.
If directAccess is true, or if directAccess is false and flags is 0 or isn’t specified, the response is returned in the following format:
{
"<text>": <long> /* Item ID: combined access level. */
}
If directAccess is true, the flags parameter is ignored.
If directAccess is false and flags isn’t 0, the response is returned in the following format:
{
"<text>": { /* Item ID. */
"cacl": <long>, /* Combined access level (flag 0x1). */
"dacl": <long> /* Direct access level (flag 0x2). */
}
}
Each object contains only the fields that correspond to the specified flags.
For the description of access rights, see Access flags.
If the request fails, an error code is returned.
Error codes
| Error code | Description |
|---|---|
| 4 | Parameter validation error. |
| 7 | Failed to fetch the user, or the current user has no Manage user’s access rights access right to the specified user. This access right isn’t required to get the access rights of the current user. |