Web API for User Management: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
(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...")
 
No edit summary
Line 34: Line 34:


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


User/group management API methods:
==Methods==


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


2. api/users/{id} GET - gets information of the user/group with given id
Returns array of user/group objects. Can be empty if criteria specified by parameters is not matched.
Returns the user/group object (can be null if not found).


3. api/users POST - creates a new user/group
<pre>
Takes the user/group object in the body (whose id is ignored if specified).
GET api/users/{id}
Returns id of the created user/group.
</pre>
Gets information of the user/group with given id. Returns the user/group object. Can return null if not found.


4. api/users PUT - updates an existing user/group
<pre>
Takes the user/group object in the body (whose isGroup is ignored if specified).
POST api/users POST
</pre>
Creates a new user/group. Takes a user/group object in the body. Note that the ''id'' property is ignored if specified. Returns id of the created user/group.


5. api/users/roleassignments/{id} GET - gets the list of role assignments of the user/group with given id
<pre>
Returns array of role assignment objects.
PUT api/users
</pre>
Updates an existing user/group. Takes a user/group object in the body. Note that the ''isGroup'' property is ignored.


6. (later) api/projects/roleassignments/{id} GET - gets the list of role assignments of the project with given id
<pre>
Returns array of role assignment objects.
GET api/users/roleassignments/{id}
</pre>
Gets a list of role assignments of the user/group with given id. Returns an array of role assignment objects.


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


8. api/users/roleassignments DELETE - removes the role assignment
<pre>
Takes the role assignment object in the body.
DELETE api/users/roleassignments
</pre>
Removes a role assignment. Takes a role assignment object in the body.


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


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


11. api/users/memberships DELETE - removes the membership
<pre>
Takes the membership object in the body.
DELETE api/users/memberships
</pre>
Removes a membership. Takes a membership object in the body.


12. api/users/roles GET - gets the list of roles
<pre>
Returns array of all role objects.
GET api/users/roles
</pre>
Gets a list of all roles in the system. Returns an array of role objects.

Revision as of 09:48, 13 August 2020

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 if role is global, false if project specific.
  • 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

Methods

GET api/users

Gets a list of users/groups. Supported query parameters:

  • isGroup (boolean): if false, only users are returned; if true, only groups are returned. Optional.
  • isActive (boolean): if false or omitted, all users/groups are returned; if true, only active users/groups are returned. Optional.

Returns array of user/group objects. Can be empty if criteria specified by parameters is not matched.

GET api/users/{id}

Gets information of the user/group with given id. Returns the user/group object. Can return null if not found.

POST api/users POST

Creates a new user/group. Takes a user/group object in the body. Note that the id property is ignored if specified. Returns id of the created user/group.

PUT api/users

Updates an existing user/group. Takes a user/group object in the body. Note that the isGroup property is ignored.

GET api/users/roleassignments/{id}

Gets a list of role assignments of the user/group with given id. Returns an array of role assignment objects.

PUT api/users/roleassignments

Adds a role assignment. Takes a role assignment object in the body.

DELETE api/users/roleassignments

Removes a role assignment. Takes a role assignment object in the body.

GET api/users/memberships/{id}

Gets a list of memberships of the user/group with given id. Returns an array of membership objects, which can be empty if user/group is not member of any group.

PUT api/users/memberships

Adds a membership. Takes a membership object in the body.

DELETE api/users/memberships

Removes a membership. Takes a membership object in the body.

GET api/users/roles

Gets a list of all roles in the system. Returns an array of role objects.