Web API for User Management

From QPR ProcessAnalyzer Wiki
Revision as of 09:35, 13 August 2020 by Ollvihe (talk | contribs) (Created page with "This page describes all Web API operations for user management. == Entities == The user management API is based on the following entities: ===User/group=== The '''User/group...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This page describes all Web API operations for user management.

Entities

The user management API is based on the following entities:

User/group

The User/group entity contains both users and groups.

Properties:

  • Id (integer): user/group id
  • IsGroup (boolean): false for users, true for groups
  • LoginName (string): user login name (empty/ignored for groups)
  • FullName (string): user/group full name
  • Email (string): user/group e-mail address
  • Password (string): user password (empty/ignored for groups)
  • IsActive (boolean): flag whether user/group is active
  • Description (string): user/group description

Role assignment

The Role assignment describes

Properties: - Id (integer): user/group id - ProjectId (integer): project id (optional, means global permission if missing) - RoleId (integer): role id

Membership

Properties: - GroupId (integer): "parent" (container) group id - MemberId (integer): "child" (member) user/group id - RoleName (enumerated string): membership role Supported membership roles: Member, HiddenMember, Administrator.

Role: - Id (integer): role id - Name (string): role name - IsGlobal (boolean): true is role is global, false otherwise - IsProject (boolean): true if role is project-specific, false otherwise Backend should ignore the following fields when updating existing role information: - MaxModels (integer): maximum number of models - MaxEvents (integer): maximum number of events - MaxCaseAttributeTypes (integer): maximum number of case attribute types - MaxEventAttributeTypes (integer): maximum number of event attribute types - MaxTables (integer): maximum number of data tables - MaxTableColumns (integer): maximum number of data table columns - MaxTableRows (integer): maximum number of data table rows

User/group management API methods:

1. api/users GET - gets the list of users/groups Supported query parameters (all optional): - isGroup (boolean): if false, only users are returned, if true, only groups are returned - isActive (boolean): if false or omitted, all users/groups are returned, if true, only active users/groups are returned If no parameters are given, all existing users and groups are returned. Returns array of user/group objects (can be empty if criteria specified by parameters is not matched).

2. api/users/{id} GET - gets information of the user/group with given id Returns the user/group object (can be null if not found).

3. api/users POST - creates a new user/group Takes the user/group object in the body (whose id is ignored if specified). Returns id of the created user/group.

4. api/users PUT - updates an existing user/group Takes the user/group object in the body (whose isGroup is ignored if specified).

5. api/users/roleassignments/{id} GET - gets the list of role assignments of the user/group with given id Returns array of role assignment objects.

6. (later) api/projects/roleassignments/{id} GET - gets the list of role assignments of the project with given id Returns array of role assignment objects.

7. api/users/roleassignments PUT - adds a role assignment Takes the role assignment object in the body.

8. api/users/roleassignments DELETE - removes the role assignment Takes the role assignment object in the body.

9. api/users/memberships/{id} GET - gets the list of memberships of the user/group with given id Returns array of membership objects (can be empty if user/group is not member of any group).

10. api/users/memberships PUT - adds a membership Takes the membership object in the body.

11. api/users/memberships DELETE - removes the membership Takes the membership object in the body.

12. api/users/roles GET - gets the list of roles Returns array of all role objects.