Class UserController
Controller class for the User
REST interface
Inheritance
UserController
Assembly: WMServer.dll
Syntax
[Route("user")]
[Authorize]
[ApiController]
public class UserController : ControllerBase
Constructors
UserController(AuthDbContext)
Declaration
public UserController(AuthDbContext context)
Parameters
Methods
DeleteUser(string)
Delete the user with the specified ID.
Declaration
[ApiExplorerSettings(IgnoreApi = true)]
[HttpDelete("{u_id}")]
public Task<IActionResult> DeleteUser(string id)
Parameters
Type |
Name |
Description |
string |
id |
The user ID, specified as a URL parameter.
|
Returns
Get(string)
Evaluate the user with the specified Id. If Id is set to 0, the information for the user
that was authenticated in the Authorization Token will be returned.
Declaration
[ApiExplorerSettings(IgnoreApi = true)]
[HttpGet("{u_id}")]
public Task<ActionResult<WMUser>> Get(string id)
Parameters
Type |
Name |
Description |
string |
id |
|
Returns
GetCurrent()
Evaluate the information about the user claimed in the JWT Token
specified in the request's Authorization header.
Declaration
[HttpGet("getCurrent")]
public Task<ActionResult<WMUser>> GetCurrent()
Returns
Type |
Description |
Task<ActionResult<WMUser>> |
Body will contain the details of the current user formatted as JSON.
|
GetOrganizations(string)
Get the list of Organizations to which the user belongs.
Declaration
[HttpGet("{id}/organizations")]
public Task<ActionResult<IEnumerable<WMOrganizationDTO>>> GetOrganizations(string id)
Parameters
Type |
Name |
Description |
string |
id |
|
Returns
GetUsers()
Evaluate a list of all users that the caller is authorized to view. If caller does not have privileges to view users,
status code 403 (Forbidden) will be returned.
Declaration
[ApiExplorerSettings(IgnoreApi = true)]
[HttpGet]
public Task<ActionResult<IEnumerable<WMUser>>> GetUsers()
Returns
PostUser(WMUserArgs)
Adds a individual new user, or as a member of an organization.
Declaration
[HttpPost]
public Task<ActionResult<UserController.WMUserArgs>> PostUser(UserController.WMUserArgs userArgs)
Parameters
Type |
Name |
Description |
UserController.WMUserArgs |
userArgs |
User details are specified as a JSON-formatted string in the request body.
|
Returns