This commit is contained in:
@@ -60,20 +60,12 @@ namespace AyaNova.Api.Controllers
|
|||||||
public async Task<IActionResult> GetList([FromQuery]AyaType ayaType, [FromQuery]string query, [FromQuery] bool inactive)
|
public async Task<IActionResult> GetList([FromQuery]AyaType ayaType, [FromQuery]string query, [FromQuery] bool inactive)
|
||||||
{
|
{
|
||||||
if (!serverState.IsOpen)
|
if (!serverState.IsOpen)
|
||||||
{
|
|
||||||
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
||||||
}
|
|
||||||
|
|
||||||
//Instantiate the business object handler
|
|
||||||
PickListBiz biz = PickListBiz.GetBiz(ct, HttpContext);
|
|
||||||
|
|
||||||
// //NOTE: This is the first check and often the only check but in some cases with some objects this will also need to check biz object rules
|
|
||||||
// if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType))
|
|
||||||
// return StatusCode(403, new ApiNotAuthorizedResponse());
|
|
||||||
|
|
||||||
if (!ModelState.IsValid)
|
if (!ModelState.IsValid)
|
||||||
return BadRequest(new ApiErrorResponse(ModelState));
|
return BadRequest(new ApiErrorResponse(ModelState));
|
||||||
|
|
||||||
|
//NOTE: these sequence of calls are a little different than other objects due to the nature of rights and stuff with picklists being different
|
||||||
|
|
||||||
var PickList = PickListFactory.GetAyaPickList(ayaType);
|
var PickList = PickListFactory.GetAyaPickList(ayaType);
|
||||||
|
|
||||||
@@ -85,9 +77,10 @@ namespace AyaNova.Api.Controllers
|
|||||||
if (!Authorized.HasAnyRole(HttpContext.Items, PickList.AllowedRoles))
|
if (!Authorized.HasAnyRole(HttpContext.Items, PickList.AllowedRoles))
|
||||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||||
|
|
||||||
|
//Instantiate the business object handler
|
||||||
|
PickListBiz biz = PickListBiz.GetBiz(ct, HttpContext);
|
||||||
|
|
||||||
var o = await biz.GetPickListAsync(PickList, query, inactive);
|
var o = await biz.GetPickListAsync(PickList, query, inactive);
|
||||||
|
|
||||||
|
|
||||||
if (o == null)
|
if (o == null)
|
||||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -165,8 +165,7 @@ namespace AyaNova.Biz
|
|||||||
roles.Add(AyaType.PickListTemplate, new BizRoleSet()
|
roles.Add(AyaType.PickListTemplate, new BizRoleSet()
|
||||||
{
|
{
|
||||||
Change = AuthorizationRoles.BizAdminFull,
|
Change = AuthorizationRoles.BizAdminFull,
|
||||||
ReadFullRecord = AuthorizationRoles.All,
|
ReadFullRecord = AuthorizationRoles.All
|
||||||
Select = AuthorizationRoles.All
|
|
||||||
});
|
});
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user