Web API for User Management
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 email address.
- Password (string): user password. Used only when creating or updating users.
- IsActive (boolean): flag whether user/group is active.
- Description (string): user/group description.
Role assignment
The Role assignment describes that a role is given to a certain user/group.
Properties: - Id (integer): user/group id - ProjectId (integer): project id for project-specific role assignments. Missing for gloobal permissions. - RoleId (integer): role id
Membership
The Membership describes that a user belongs to a group.
Properties: - GroupId (integer): parent (container) group id. - MemberId (integer): child (member) user/group id. - RoleName (string): membership role. Supported membership types are Member, HiddenMember, Administrator.
Role
The Roles describles available roles in the system.
Properties:
- 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
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.