Skip to content

Added documentation for User role management endpoints #3399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions apinf_packages/rest_apis/lib/descriptions/users_texts.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,39 @@ const descriptionUsers = {
As a response is returned an array containing Users, which have been created within
last seven days and who are managers in Organization identified with org-id.
`,
// --------------------------------------------
postUserRole: `
### Add a role to User ###

With this method an Admin can provide to a User a new role, which is "admin" or "manager".

Parameters:
* *Users id* (is given as a path parameter) is mandatory
* *role* (is given as a body parameter) is mandatory

Example call:

GET /users/<users-id>/roles

As a response is returned an array containing updated User data.
`,
// --------------------------------------------
deleteUserRole: `
### Remove a role from a User ###

With this method an Admin can remove from a User a role, which is "admin" or "manager".

Parameters:
* *Users id* (is given as a path parameter) is mandatory
* *role* (is given as a body parameter) is mandatory

Example call:

GET /users/<users-id>/roles?role=manager

Removes the role "manager" from User identified with users-id and responses
with HTTP code 204 without content.
`,
};

export default descriptionUsers;
6 changes: 4 additions & 2 deletions apinf_packages/users/server/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ ManagementV1.swagger.meta.paths = {
tags: [
ManagementV1.swagger.tags.users,
],
summary: 'Add a role to User with userId',
summary: 'Add a specified role to a User.',
description: descriptionUsers.postUserRole,
produces: ['application/json'],
parameters: [
ManagementV1.swagger.params.userId,
Expand Down Expand Up @@ -331,7 +332,8 @@ ManagementV1.swagger.meta.paths = {
tags: [
ManagementV1.swagger.tags.users,
],
summary: 'Remove specified role of User with userID.',
summary: 'Remove a specified role from a User.',
description: descriptionUsers.deleteUserRole,
parameters: [
ManagementV1.swagger.params.userId,
ManagementV1.swagger.params.removeRole,
Expand Down