This commit is contained in:
2021-03-10 17:47:33 +00:00
parent 8b35e091d4
commit 34fa34e53d
2 changed files with 10 additions and 3 deletions

View File

@@ -13,8 +13,6 @@ using AyaNova.Biz;
using AyaNova.Util; using AyaNova.Util;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using EnumsNET;
using AyaNova.DataList;
namespace AyaNova.Api.Controllers namespace AyaNova.Api.Controllers
{ {

View File

@@ -341,6 +341,11 @@ namespace AyaNova.Biz
var log = AyaNova.Util.ApplicationLogging.CreateLogger("ReportBiz::GetReportData"); var log = AyaNova.Util.ApplicationLogging.CreateLogger("ReportBiz::GetReportData");
AuthorizationRoles effectiveRoles = CurrentUserRoles; AuthorizationRoles effectiveRoles = CurrentUserRoles;
if (selectedRequest.ObjectType == AyaType.NoType)
{
AddError(ApiErrorCode.VALIDATION_REQUIRED, null, $"ObjectType is required");
return null;
}
if (!AyaNova.Api.ControllerHelpers.Authorized.HasReadFullRole(effectiveRoles, selectedRequest.ObjectType)) if (!AyaNova.Api.ControllerHelpers.Authorized.HasReadFullRole(effectiveRoles, selectedRequest.ObjectType))
{ {
@@ -400,6 +405,10 @@ namespace AyaNova.Biz
//Get data //Get data
var ReportData = await GetReportData(reportRequest); var ReportData = await GetReportData(reportRequest);
//if GetReportData errored then will return null so need to return that as well here
if(ReportData==null){
return null;
}
//initialization //initialization
log.LogDebug("Initializing report system"); log.LogDebug("Initializing report system");