This commit is contained in:
@@ -82,8 +82,10 @@ namespace AyaNova.Api.Controllers
|
||||
[HttpGet("status/{gid}")]
|
||||
public async Task<IActionResult> GetJobStatus([FromRoute] Guid gid)
|
||||
{
|
||||
if (serverState.IsClosed)
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
//this is called from things that might be running and have server temporarily locked down (e.g. seeding)
|
||||
//so it should never return an error on closed
|
||||
// if (serverState.IsClosed)
|
||||
// return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
|
||||
//This is called by the UI to monitor any operation that triggers a job so it really should be available to any logged in user
|
||||
// if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.ServerJob))
|
||||
|
||||
136
server/AyaNova/DataList/UserDataList.cs
Normal file
136
server/AyaNova/DataList/UserDataList.cs
Normal file
@@ -0,0 +1,136 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class UserDataList : AyaDataList
|
||||
{
|
||||
|
||||
public UserDataList()
|
||||
{
|
||||
DefaultListObjectType = AyaType.User;
|
||||
SQLFrom = "from auser";
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
|
||||
//Default ListView
|
||||
dynamic dlistView = new JArray();
|
||||
|
||||
dynamic cm = new JObject();
|
||||
cm.fld = "username";
|
||||
dlistView.Add(cm);
|
||||
|
||||
cm = new JObject();
|
||||
cm.fld = "useremployeenumber";
|
||||
dlistView.Add(cm);
|
||||
|
||||
cm = new JObject();
|
||||
cm.fld = "useractive";
|
||||
dlistView.Add(cm);
|
||||
|
||||
// cm = new JObject();
|
||||
// cm.fld = "usernotes";
|
||||
// dlistView.Add(cm);
|
||||
|
||||
cm = new JObject();
|
||||
cm.fld = "userroles";
|
||||
dlistView.Add(cm);
|
||||
|
||||
cm = new JObject();
|
||||
cm.fld = "userlastlogin";
|
||||
dlistView.Add(cm);
|
||||
|
||||
|
||||
DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
|
||||
|
||||
|
||||
|
||||
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined (in this case User) table need to be specified completely
|
||||
FieldDefinitions = new List<AyaDataListFieldDefinition>();
|
||||
//DPRECATED FieldDefinitions.Add(new AyaDataListFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.User, SqlIdColumnName = "auser.id" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "User",
|
||||
FieldKey = "username",
|
||||
AyaObjectType = (int)AyaType.User,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "auser.id",
|
||||
SqlValueColumnName = "auser.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "useractive",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "auser.active"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "AuthorizationRoles",
|
||||
FieldKey = "userroles",
|
||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(AuthorizationRoles).ToString()),
|
||||
SqlValueColumnName = "auser.roles"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "LastLogin",
|
||||
FieldKey = "userlastlogin",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "auser.lastlogin"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "UserType",
|
||||
FieldKey = "usertype",
|
||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(UserType).ToString()),
|
||||
SqlValueColumnName = "auser.usertype"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "UserEmployeeNumber",
|
||||
FieldKey = "useremployeenumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "auser.employeenumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "UserNotes",
|
||||
FieldKey = "usernotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "auser.notes"
|
||||
});
|
||||
|
||||
|
||||
// //-------------------------
|
||||
//NOT SURE ABOUT CUSTOM FIELDS
|
||||
//NEED TO COME BACK TO THIS ONCE CLIENT IS CONSUMING THESE LISTS
|
||||
//WIDGETLIST has custom fields so good test before doing here
|
||||
|
||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom1", FieldKey = "widgetcustom1", IsCustomField = true });
|
||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom2", FieldKey = "widgetcustom2", IsCustomField = true });
|
||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom3", FieldKey = "widgetcustom3", IsCustomField = true });
|
||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom4", FieldKey = "widgetcustom4", IsCustomField = true });
|
||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom5", FieldKey = "widgetcustom5", IsCustomField = true });
|
||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom6", FieldKey = "widgetcustom6", IsCustomField = true });
|
||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom7", FieldKey = "widgetcustom7", IsCustomField = true });
|
||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom8", FieldKey = "widgetcustom8", IsCustomField = true });
|
||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom9", FieldKey = "widgetcustom9", IsCustomField = true });
|
||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom10", FieldKey = "widgetcustom10", IsCustomField = true });
|
||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom11", FieldKey = "widgetcustom11", IsCustomField = true });
|
||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom12", FieldKey = "widgetcustom12", IsCustomField = true });
|
||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom13", FieldKey = "widgetcustom13", IsCustomField = true });
|
||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom14", FieldKey = "widgetcustom14", IsCustomField = true });
|
||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom15", FieldKey = "widgetcustom15", IsCustomField = true });
|
||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom16", FieldKey = "widgetcustom16", IsCustomField = true });
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
@@ -94,6 +94,7 @@ namespace AyaNova.Biz
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "UserNotes", FieldKey = "Notes" });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "UserType", FieldKey = "UserType", Hideable = false });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "Active", FieldKey = "Active", Hideable = false });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "LastLogin", FieldKey = "LastLogin" });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "Tags", FieldKey = "Tags" });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "Wiki", FieldKey = "Wiki" });
|
||||
l.Add(new AyaFormFieldDefinition { TKey = "Attachments", FieldKey = "Attachments" });
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace AyaNova.Models
|
||||
public dtUser()
|
||||
{
|
||||
Tags = new List<string>();
|
||||
LastLogin = DateTime.MinValue;
|
||||
|
||||
}
|
||||
public long Id { get; set; }
|
||||
public uint Concurrency { get; set; }
|
||||
@@ -29,7 +29,7 @@ namespace AyaNova.Models
|
||||
public string CustomFields { get; set; }
|
||||
public List<string> Tags { get; set; }
|
||||
|
||||
public DateTime LastLogin { get; set; }
|
||||
public DateTime? LastLogin { get; set; }
|
||||
}//eoc
|
||||
|
||||
public class User : ICoreBizObjectModel
|
||||
@@ -42,7 +42,7 @@ namespace AyaNova.Models
|
||||
[Required, MaxLength(255)]
|
||||
public string Name { get; set; }
|
||||
|
||||
public DateTime LastLogin { get; set; }
|
||||
public DateTime? LastLogin { get; set; }
|
||||
|
||||
public string Login { get; set; }
|
||||
public string Password { get; set; }
|
||||
@@ -82,6 +82,7 @@ namespace AyaNova.Models
|
||||
public User()
|
||||
{
|
||||
Tags = new List<string>();
|
||||
|
||||
}
|
||||
|
||||
public bool IsTech
|
||||
|
||||
@@ -1834,5 +1834,6 @@
|
||||
"JobFailed":"Job fehlgeschlagen",
|
||||
"MaintenanceExpired":"Wartung abgelaufen",
|
||||
"MaintenanceExpiredNote":"Das Support- und Update-Abonnement ist jetzt abgelaufen.\nAyaNova kann nicht aktualisiert werden und der Support ist nicht mehr verfügbar",
|
||||
"CopyDbId":"Datenbank-ID kopieren"
|
||||
"CopyDbId":"Datenbank-ID kopieren",
|
||||
"LastLogin":"Letzte Anmeldezeit"
|
||||
}
|
||||
@@ -1833,7 +1833,8 @@
|
||||
"JobFailed":"Job failed",
|
||||
"MaintenanceExpired":"Maintenance expired",
|
||||
"MaintenanceExpiredNote":"The support and updates subscription has now expired\nAyaNova can not be updated and support is no longer available",
|
||||
"CopyDbId":"Copy database id"
|
||||
"CopyDbId":"Copy database id",
|
||||
"LastLogin":"Last login"
|
||||
|
||||
|
||||
}
|
||||
@@ -1834,5 +1834,6 @@
|
||||
"JobFailed":"Trabajo fallido",
|
||||
"MaintenanceExpired":"Mantenimiento expirado",
|
||||
"MaintenanceExpiredNote":"La suscripción de soporte y actualizaciones ha caducado\nAyaNova no se puede actualizar y el soporte ya no está disponible",
|
||||
"CopyDbId":"Copiar ID de base de datos"
|
||||
"CopyDbId":"Copiar ID de base de datos",
|
||||
"LastLogin":"Última hora de inicio de sesión"
|
||||
}
|
||||
@@ -1834,5 +1834,6 @@
|
||||
"JobFailed":"Le travail a échoué",
|
||||
"MaintenanceExpired":"Maintenance expirée",
|
||||
"MaintenanceExpiredNote":"L'abonnement au support et aux mises à jour a expiré\nAyaNova ne peut pas être mis à jour et le support n'est plus disponible",
|
||||
"CopyDbId":"Copier l'ID de la base de données"
|
||||
"CopyDbId":"Copier l'ID de la base de données",
|
||||
"LastLogin":"Dernière connexion"
|
||||
}
|
||||
Reference in New Issue
Block a user