This commit is contained in:
@@ -49,7 +49,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
/// Get full DataListView object
|
/// Get full DataListView object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <returns>A single DataFilter</returns>
|
/// <returns>A single DataListView</returns>
|
||||||
[HttpGet("{id}")]
|
[HttpGet("{id}")]
|
||||||
public async Task<IActionResult> GetDataListView([FromRoute] long id)
|
public async Task<IActionResult> GetDataListView([FromRoute] long id)
|
||||||
{
|
{
|
||||||
@@ -152,7 +152,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
//Instantiate the business object handler
|
//Instantiate the business object handler
|
||||||
DataListViewBiz biz = DataListViewBiz.GetBiz(ct, HttpContext);
|
DataListViewBiz biz = DataListViewBiz.GetBiz(ct, HttpContext);
|
||||||
|
|
||||||
//check roles
|
//check roles
|
||||||
if (!Authorized.HasCreateRole(HttpContext.Items, biz.BizType))
|
if (!Authorized.HasCreateRole(HttpContext.Items, biz.BizType))
|
||||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||||
|
|
||||||
@@ -200,6 +200,34 @@ namespace AyaNova.Api.Controllers
|
|||||||
return NoContent();
|
return NoContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get default ListView for DataList
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dataListKey">Key of an existing DataList</param>
|
||||||
|
/// <returns>A single DataListView</returns>
|
||||||
|
[HttpGet("/default/{dataListKey}")]
|
||||||
|
public ActionResult GetDefaultDataListView([FromRoute] string dataListKey)
|
||||||
|
{
|
||||||
|
if (serverState.IsClosed)
|
||||||
|
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
||||||
|
|
||||||
|
//Instantiate the business object handler
|
||||||
|
DataListViewBiz biz = DataListViewBiz.GetBiz(ct, HttpContext);
|
||||||
|
|
||||||
|
if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType))
|
||||||
|
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||||
|
|
||||||
|
if (!ModelState.IsValid)
|
||||||
|
return BadRequest(new ApiErrorResponse(ModelState));
|
||||||
|
|
||||||
|
var o = AyaNova.DataList.DataListFactory.GetAyaDataList(dataListKey); ;
|
||||||
|
if (o == null)
|
||||||
|
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
||||||
|
|
||||||
|
return Ok(ApiOkResponse.Response(o, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//------------
|
//------------
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user