Class OrganizationController
Controller class for the User
REST interface
Inherited Members
Namespace: Quantellia.WMServer.Auth
Assembly: WMServer.dll
Syntax
[Route("organization")]
[Authorize]
[ApiController]
public class OrganizationController : ControllerBase
Constructors
OrganizationController(AuthDbContext)
Declaration
public OrganizationController(AuthDbContext context)
Parameters
Type | Name | Description |
---|---|---|
AuthDbContext | context |
Methods
AssociateUserRole(string, AssociateUserRoleArgs)
Associate a user with a specified role to an organization.
Declaration
[HttpPost("{orgId}/user")]
public Task<IActionResult> AssociateUserRole(string orgId, OrganizationController.AssociateUserRoleArgs userRole)
Parameters
Type | Name | Description |
---|---|---|
string | orgId | The Organization ID |
OrganizationController.AssociateUserRoleArgs | userRole | Object containing the user ID and role to be associated with this Organization. |
Returns
Type | Description |
---|---|
Task<IActionResult> |
Create(WMOrganizationArgs)
Adds a new organization.
Declaration
[HttpPost]
public Task<ActionResult<WMOrganization>> Create(OrganizationController.WMOrganizationArgs args)
Parameters
Type | Name | Description |
---|---|---|
OrganizationController.WMOrganizationArgs | args | Organization details are specified as a JSON-formatted string in the request body. |
Returns
Type | Description |
---|---|
Task<ActionResult<WMOrganization>> |
Delete(string)
Delete the organization with the specified ID.
Declaration
[HttpDelete("{id}")]
public Task<IActionResult> Delete(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | The organization ID, specified as a URL parameter. |
Returns
Type | Description |
---|---|
Task<IActionResult> |
DisassociateUser(string, string)
Disassociate a user from an organization entirely.
Declaration
[HttpDelete("{oId}/user/{uId}")]
public Task<IActionResult> DisassociateUser(string oId, string uId)
Parameters
Type | Name | Description |
---|---|---|
string | oId | The Organization ID |
string | uId | The User ID |
Returns
Type | Description |
---|---|
Task<IActionResult> |
DisassociateUserRole(string, string, string)
Disassociate a user from an organization with only the attached role.
Declaration
[HttpDelete("{oId}/user/{uId}/{role}")]
public Task<IActionResult> DisassociateUserRole(string oId, string uId, string role)
Parameters
Type | Name | Description |
---|---|---|
string | oId | The Organization ID |
string | uId | The User ID |
string | role | The role's name |
Returns
Type | Description |
---|---|
Task<IActionResult> |
Get()
Evaluate a list of all organizations that the caller is authorized to view. If caller does not have privileges to view any organizations, status code 403 (Forbidden) will be returned.
Declaration
[HttpGet]
public Task<ActionResult<IEnumerable<WMOrganization>>> Get()
Returns
Type | Description |
---|---|
Task<ActionResult<IEnumerable<WMOrganization>>> |
Get(string)
Evaluate the organization with the specified Id.
Declaration
[HttpGet("{id}")]
public Task<ActionResult<WMOrganization>> Get(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | The ID of the organization |
Returns
Type | Description |
---|---|
Task<ActionResult<WMOrganization>> |
Update(string, WMOrganizationArgs)
Updates an organization with the specified id.
Declaration
[HttpPut("{id}")]
public Task<ActionResult<WMOrganization>> Update(string id, OrganizationController.WMOrganizationArgs args)
Parameters
Type | Name | Description |
---|---|---|
string | id | ID of the Organization whose properties are to be updated. |
OrganizationController.WMOrganizationArgs | args | Organization details are specified as a JSON-formatted string in the request body. |
Returns
Type | Description |
---|---|
Task<ActionResult<WMOrganization>> |