From 0302add504fd6e0fa49aaf4d49ea86552cf411cf Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 25 Mar 2020 18:40:03 +0000 Subject: [PATCH] --- .../GlobalBizSettingsController.cs | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/server/AyaNova/Controllers/GlobalBizSettingsController.cs b/server/AyaNova/Controllers/GlobalBizSettingsController.cs index ecfb2876..2e753774 100644 --- a/server/AyaNova/Controllers/GlobalBizSettingsController.cs +++ b/server/AyaNova/Controllers/GlobalBizSettingsController.cs @@ -96,5 +96,38 @@ namespace AyaNova.Api.Controllers return NoContent(); } + /// + /// Get Client app relevant GlobalBizSettings + /// + /// Global settings object + [HttpGet("client")] + public ActionResult GetClientGlobalBizSettings() + { + if (serverState.IsClosed) + return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason)); + + //Instantiate the business object handler + // GlobalBizSettingsBiz biz = GlobalBizSettingsBiz.GetBiz(ct, HttpContext); + + //this route is available to any logged in user as it contains a subset of limited options relevant to any logged in user + // if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType)) + // return StatusCode(403, new ApiNotAuthorizedResponse()); + + if (!ModelState.IsValid) + return BadRequest(new ApiErrorResponse(ModelState)); + + // var o = await biz.GetAsync(); + // if (o == null) + // return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND)); + + //new object with only relevant items in it + var ret = new + { + SearchCaseSensitiveOnly = AyaNova.Util.ServerGlobalBizSettings.SearchCaseSensitiveOnly + }; + + return Ok(ApiOkResponse.Response(ret, true)); + } + }//eoc }//ens \ No newline at end of file