These docs are for v20.3.44. Click to read the latest docs for v20.3.186.

Discussions

Ask a Question
Back to All

UserRoles

(edited)

Hi ASI Support,

I am trying to get all users with SysAdmin Roles and opening some functionality that is available for only SysAdmins.
While trying REST API Endpoints, I discovered two bugs, here are the details:

BUG - 1
https://URL/api/User/:PartyID
This Endpoint has a Role property but returns null for the user, which definitely has a SysAdmin role and also OnBehalfOf Role.

Also, in iMIS SysAdmin Role Key is "8e5c7c1d-170b-4294-b646-2e60d2091df8"
So, I tried validating the same user with the following endpoint and it validates that this user has SysAdmin Role.

https://URL/api/UserRole/~8e5c7c1d-170b-4294-b646-2e60d2091df8|e982d078-994a-4bf9-b424-1010e64097d4

I think this is a bug at api/User Endpoint which does not return the correct Roles for a user.
https://URL/api/User/:PartyID

BUG - 2
Another bug is TWO different kinds of JSON Responses returned by api/User Endpoint.
Steps to create:

  1. Identify any Full User in the system under Security and note down its Username, PartyID and Roles.
  2. Query for https://URL/api/User/PartyID, you will see JSON response(First Kind) which has the Roles and fewer properties about that user.
  3. Query for https://URL/api/User?UserName=eq:Username and you will see a different JSON because it is searching all Users in the system, which is fine.
  4. But now run the Query in Step 2 again, the JSON response(Second Kind) will be changed and have more properties similar to the response returned in Step-3, Roles Property which was correct in Step-2 and now are always null(which is Bug -1)

This was identified in Service Pack O.
Let me know if need a demo!