Class UserController
Controller class for the User
REST interface
Inherited Members
Namespace: Quantellia.WMServer.Auth
Assembly: WMServer.dll
Syntax
[Route("user")]
[ApiController]
public class UserController : ControllerBase
Constructors
UserController(AuthDbContext)
Declaration
public UserController(AuthDbContext context)
Parameters
Type | Name | Description |
---|---|---|
AuthDbContext | context |
Methods
DeleteUser(string)
Delete the user with the specified ID.
Declaration
[ApiExplorerSettings(IgnoreApi = true)]
[HttpDelete("{id}")]
public Task<IActionResult> DeleteUser(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | The user ID, specified as a URL parameter. |
Returns
Type | Description |
---|---|
Task<IActionResult> |
Get(string)
Get 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("{id}")]
public Task<ActionResult<WMUser>> Get(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id |
Returns
Type | Description |
---|---|
Task<ActionResult<WMUser>> |
GetCurrent()
Get 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. |
GetUsers()
Get 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
Type | Description |
---|---|
Task<ActionResult<IEnumerable<WMUser>>> |
PostUser(WMUserArgs)
Adds a individual new user, or as a member of an organization.
Declaration
[ApiExplorerSettings(IgnoreApi = true)]
[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
Type | Description |
---|---|
Task<ActionResult<UserController.WMUserArgs>> |