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 Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using EnumsNET;
using AyaNova.DataList;
namespace AyaNova.Api.Controllers
{

View File

@@ -341,6 +341,11 @@ namespace AyaNova.Biz
var log = AyaNova.Util.ApplicationLogging.CreateLogger("ReportBiz::GetReportData");
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))
{
@@ -399,7 +404,11 @@ namespace AyaNova.Biz
//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
log.LogDebug("Initializing report system");