This commit is contained in:
2018-11-29 18:07:37 +00:00
parent 563efd6d66
commit 9478cd72b8

View File

@@ -78,12 +78,38 @@ namespace AyaNova.Api.Controllers
}
/// <summary>
/// Get filter options
///
/// Required roles:
/// BizAdminFull, InventoryFull, BizAdminLimited, InventoryLimited, TechFull, TechLimited, Accounting
///
/// </summary>
/// <returns>Filter options</returns>
[HttpGet("FilterOptions")]
public ActionResult FilterOptions()
{
if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
//Instantiate the business object handler
WidgetBiz biz = WidgetBiz.GetBiz(ct, HttpContext);
if (!Authorized.IsAuthorizedToReadFullRecord(HttpContext.Items, biz.BizType))
return StatusCode(401, new ApiNotAuthorizedResponse());
return Ok(new
{
data = biz.FilterOptions
});
}
/// <summary>
/// Get paged list of widgets
///
/// Required roles: Any
///
/// Required roles:
/// BizAdminFull, InventoryFull, BizAdminLimited, InventoryLimited, TechFull, TechLimited, Accounting
/// </summary>
/// <returns>Paged collection of widgets with paging data</returns>
[HttpGet("ListWidgets", Name = nameof(ListWidgets))]//We MUST have a "Name" defined or we can't get the link for the pagination, non paged urls don't need a name