This commit is contained in:
2020-06-10 14:40:12 +00:00
parent 7ffee42684
commit ff20c44710
5 changed files with 71 additions and 17 deletions

View File

@@ -46,9 +46,8 @@ namespace AyaNova.Api.Controllers
{
if (serverState.IsClosed)
{
//Exception for manager account to handle licensing issues
if (UserIdFromContext.Id(HttpContext.Items) != 1)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
}
//Instantiate the business object handler
@@ -102,7 +101,11 @@ namespace AyaNova.Api.Controllers
public ActionResult GetClientGlobalBizSettings()
{
if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
{
//Exception for manager account to handle licensing issues
if (UserIdFromContext.Id(HttpContext.Items) != 1)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
}
//Instantiate the business object handler
// GlobalBizSettingsBiz biz = GlobalBizSettingsBiz.GetBiz(ct, HttpContext);
@@ -118,10 +121,23 @@ namespace AyaNova.Api.Controllers
// if (o == null)
// return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
// Return a license state enumeration value
// 0 = No license at all of any kind
// 1 = trial license key
// 2 = purchased license key
// 3 = purchased but expired key (license itself is expired, not the maintenance, that's seperate)
// Note: this has nothing to do with whether there is an active license or not, merely that it's of a type
// this is so client can display appropriate UI
//new object with only relevant items in it
var ret = new
{
SearchCaseSensitiveOnly = AyaNova.Util.ServerGlobalBizSettings.SearchCaseSensitiveOnly
SearchCaseSensitiveOnly = AyaNova.Util.ServerGlobalBizSettings.SearchCaseSensitiveOnly,
LicenseState = AyaNova.Core.License.ActiveKey.Status
};
return Ok(ApiOkResponse.Response(ret));