mng.GetUserRoles

This job lists the system roles for the logged-in user or a specified user.

Without specifying a user, the system roles of the logged-in user are listed.

1. Input Parameters

Name Type Required Description

Flags

INT

Yes

Currently not supported → pass 0

UserGUID

STRING

Yes

GUID of the user. Empty or GUID of the logged-in user: no system role required. GUID of another user: system role 4 required. An unknown or invalid GUID produces no error — see Unknown UserGUID.

[UserId]

STRING

No

ID of the user; currently has no effect and is ignored by the server

2. Output Parameters

Name Type Dependency Description

Result

String

—

List of system role IDs, separated by semicolon. See System Roles. Empty if the user has no system role — or if the user does not exist (see Unknown UserGUID).

3. Return Value

(INT): 0 = Job successful, otherwise error code

4. Required System Role

The system role is only checked when querying other users:

  • UserGUID omitted, empty or equal to the GUID of the logged-in user — no system role is required; every user may query their own system roles.

  • UserGUID of another user — the calling user requires system role 4 (Administrator: Configure security system — configure the rights system). If this role is missing, the call is rejected with the error code -1040906164 (verified); see Error Codes.

If the job is called with a context switch, role 4 is checked on the target user, not on the logged-in account.

An overview of all roles is available under System Roles.

5. Unknown UserGUID

The UserGUID parameter never produces an error code. An unknown GUID, a syntactically invalid string (NOT-A-GUID) and the null GUID all return return_code = 0 and an empty Result (verified).

An empty Result therefore does not necessarily mean "the user has no system role" — it can equally mean "the user does not exist". Anyone who has to distinguish both cases checks the existence of the user in advance with mng.GetUserList or mng.GetUserAttributes.

6. Context Switch Errors

If the job is called with a context switch, the error code -1043332467 does not relate to the UserGUID parameter but to the target user of the context switch — that user is unknown, blocked, expired or not yet valid. These four cases can only be distinguished via the error stack; see Context Switch Errors.

Since mng.GetUserRoles is often the first job after a context switch, the error frequently shows up here although it does not originate from this job.