pixiGetUserPermissions
Returns Pixi users with their names and a semicolon-separated list of permission codes derived from their roles.
Returns the permission codes of one Pixi user or of all users.
- If
UserNameis given, only that user is returned. If it is empty orNULL, all users are returned. - The built-in user
masteris always excluded. - Only users that have at least one role assigned are considered. Users without roles are not returned at all.
- Permission codes come from the user's roles through the role-to-permission assignments. Each code appears at most once per user, even if several roles grant it.
The call returns one row per user. PermissionCode holds all codes of that user joined with ;.
If no matching user is found, a status row with Status = Error is returned instead.
Notes
- All tables are read with
NOLOCK, so uncommitted data may be returned. - Each permission code is converted to
varchar(10)before it is joined. Longer codes are cut off. - If a user's roles grant no permissions,
PermissionCodeisNULL. - Neither the rows nor the codes inside
PermissionCodehave a guaranteed order. - The list is built with
FOR XML PATH. Characters such as&,<or>would therefore appear XML-escaped. - When all users are requested and none is found, the error message names an empty user name (
'').
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
UserName
|
varchar(50) string |
– |
Login name of the user. Empty or Example: |
Result set 1 · If at least one matching user with a role exists
One row per user with names and the joined permission codes.
| Column | Type | Description |
|---|---|---|
UserName
|
string |
Login name of the user. |
FirstName
Nullable |
string |
First name of the user. |
LastName
Nullable |
string |
Last name of the user. |
PermissionCode
Nullable |
nvarchar(max) string |
Permission codes of the user, separated by |
Result set 2 · If no matching user is found
Status row with the error.
| Column | Type | Description |
|---|---|---|
Status
|
varchar(5) string |
Always |
Message
|
varchar(95) string |
Error text containing the requested user name. |
Response example
<SqlRowSet1>
<row>
<UserName>jdoe</UserName>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
<PermissionCode>101;102;205</PermissionCode>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| Error | Could not find the user with the username '{UserName}' | No user matches the given name, the user is `master`, or the user has no role assigned. Check the login name and the user's role assignment. |
POST https://apigateway.descartes.com/tms/pixi/
Content-Type: text/xml; charset=utf-8
Authorization: Basic BASE64(USERNAME:PASSWORD)
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
<SOAP-ENV:Body>
<ns1:pixiGetUserPermissions>
<!-- <UserName>jdoe</UserName> -->
</ns1:pixiGetUserPermissions>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
curl -X POST 'https://apigateway.descartes.com/tms/pixi/' \
--user 'USERNAME:PASSWORD' \
--header 'Content-Type: text/xml; charset=utf-8' \
--data-binary @- <<'XML'
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
<SOAP-ENV:Body>
<ns1:pixiGetUserPermissions>
<!-- <UserName>jdoe</UserName> -->
</ns1:pixiGetUserPermissions>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML
<?php
$soapClient = new SoapClient(null, [
'login' => 'USERNAME',
'password' => 'PASSWORD',
'location' => 'https://apigateway.descartes.com/tms/pixi/',
'uri' => 'https://apigateway.descartes.com/tms/pixi/',
]);
$arguments = [
// 'UserName' => 'jdoe',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetUserPermissions', $soapArguments);
- SQL object:
- dbo.pipiGetUserPermissions