This commit is contained in:
@@ -550,7 +550,7 @@ namespace AyaNova.Biz
|
||||
roles.Add(AyaType.Report, new BizRoleSet()
|
||||
{
|
||||
Change = AuthorizationRoles.BizAdminFull | AuthorizationRoles.BizAdminLimited,
|
||||
ReadFullRecord = AuthorizationRoles.BizAdminLimited | AuthorizationRoles.BizAdminLimited,
|
||||
ReadFullRecord = AuthorizationRoles.All,
|
||||
Select = AuthorizationRoles.All
|
||||
});
|
||||
|
||||
|
||||
@@ -225,6 +225,29 @@ namespace AyaNova.Biz
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//REPORT DATA
|
||||
//Data fetched to return to report designer for Client report design usage
|
||||
|
||||
public async Task<Newtonsoft.Json.Linq.JArray> GetReportData(AyaType objectType, long[] objectidarray)
|
||||
{
|
||||
var log = AyaNova.Util.ApplicationLogging.CreateLogger("ReportBiz::GetReportData");
|
||||
AuthorizationRoles effectiveRoles = CurrentUserRoles;
|
||||
if (!AyaNova.Api.ControllerHelpers.Authorized.HasReadFullRole(effectiveRoles, objectType))
|
||||
{
|
||||
AddError(ApiErrorCode.NOT_AUTHORIZED, null, $"User not authorized for {objectType} type object");
|
||||
return null;
|
||||
}
|
||||
//Get data
|
||||
log.LogDebug($"Instantiating biz object handler for {objectType}");
|
||||
var biz = BizObjectFactory.GetBizObject(objectType, ct);
|
||||
log.LogDebug($"Fetching data for {objectidarray.Length} {objectType} items");
|
||||
return await ((IReportAbleObject)biz).GetReportData(objectidarray);
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//RENDER
|
||||
//
|
||||
@@ -270,7 +293,7 @@ namespace AyaNova.Biz
|
||||
log.LogDebug($"Instantiating biz object handler for {report.ObjectType}");
|
||||
var biz = BizObjectFactory.GetBizObject(report.ObjectType, ct);
|
||||
log.LogDebug($"Fetching data for {objectidarray.Length} {report.ObjectType} items");
|
||||
var data = ((IReportAbleObject)biz).GetReportData(objectidarray).ToString();
|
||||
var data = (await ((IReportAbleObject)biz).GetReportData(objectidarray)).ToString();
|
||||
|
||||
//initialization
|
||||
log.LogDebug("Initializing report system");
|
||||
|
||||
Reference in New Issue
Block a user