case 4727 - DB ID and licence to staff only
server-info returns the DB ID and licence, and global-biz-setting/client the DB ID and licensee, only to Service and NotService users, as the About form already shows them; customer contacts and subcontractors get empty values. F29 fixed, AyaNova half of F39 done (4727 step 3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -119,6 +119,9 @@ namespace AyaNova.Api.Controllers
|
||||
[HttpGet("server-info")]
|
||||
public ActionResult ServerInfo()
|
||||
{
|
||||
//case 4727 (F29): the DB ID and licence go to staff only (Service, NotService), as the About form shows them
|
||||
var userType = UserTypeFromContext.Type(HttpContext.Items);
|
||||
bool staff = userType == UserType.Service || userType == UserType.NotService;
|
||||
return Ok(new
|
||||
{
|
||||
data = new
|
||||
@@ -127,8 +130,8 @@ namespace AyaNova.Api.Controllers
|
||||
DBSchemaVersion = AySchema.currentSchema,
|
||||
ServerLocalTime = DateUtil.ServerDateTimeString(System.DateTime.UtcNow),
|
||||
ServerTimeZone = TimeZoneInfo.Local.Id,
|
||||
ServerDbId = AyaNova.Core.License.ServerDbId,
|
||||
License = AyaNova.Core.License.LicenseInfoAsJson,
|
||||
ServerDbId = staff ? AyaNova.Core.License.ServerDbId : string.Empty,
|
||||
License = staff ? AyaNova.Core.License.LicenseInfoAsJson : null,
|
||||
#if (SUBSCRIPTION_BUILD)
|
||||
Build = "Subscription"
|
||||
#else
|
||||
|
||||
@@ -109,6 +109,10 @@ namespace AyaNova.Api.Controllers
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
}
|
||||
|
||||
//case 4727 (F29): the DB ID and licensee go to staff only (Service, NotService)
|
||||
var userType = UserTypeFromContext.Type(HttpContext.Items);
|
||||
bool staff = userType == UserType.Service || userType == UserType.NotService;
|
||||
|
||||
bool IsSubscriptionBuild = false;
|
||||
|
||||
#if (SUBSCRIPTION_BUILD)
|
||||
@@ -136,8 +140,8 @@ namespace AyaNova.Api.Controllers
|
||||
//used to drive UI in case of unlicensed or attention required
|
||||
LicenseStatus = AyaNova.Core.License.ActiveKey.Status,
|
||||
MaintenanceExpired = AyaNova.Core.License.ActiveKey.MaintenanceExpired,
|
||||
ServerDbId = AyaNova.Core.License.ServerDbId,
|
||||
Company = AyaNova.Core.License.ActiveKey.RegisteredTo,
|
||||
ServerDbId = staff ? AyaNova.Core.License.ServerDbId : string.Empty,
|
||||
Company = staff ? AyaNova.Core.License.ActiveKey.RegisteredTo : string.Empty,
|
||||
SBuild = IsSubscriptionBuild,
|
||||
//used to drive UI in case of out of date release message to be shown to staff users non subscription only
|
||||
ShowUpdateAvailable = (Util.AyaNovaVersion.VersionString != AyaNova.Util.ServerGlobalOpsSettingsCache.LATEST_VERSION && !IsSubscriptionBuild),
|
||||
|
||||
Reference in New Issue
Block a user