This commit is contained in:
@@ -76,6 +76,8 @@ namespace AyaNova.Api.Controllers
|
|||||||
|
|
||||||
List<KeyValuePair<string, string>> ret = new List<KeyValuePair<string, string>>();
|
List<KeyValuePair<string, string>> ret = new List<KeyValuePair<string, string>>();
|
||||||
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(UserType).ToString()), "AyaNova user account types"));
|
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(UserType).ToString()), "AyaNova user account types"));
|
||||||
|
ret.Add(new KeyValuePair<string, string>("insideusertype", "AyaNova user account types for staff / contractors"));
|
||||||
|
ret.Add(new KeyValuePair<string, string>("outsideusertype", "AyaNova user account types for customer / headoffice users"));
|
||||||
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(AuthorizationRoles).ToString()), "AyaNova user account role types"));
|
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(AuthorizationRoles).ToString()), "AyaNova user account role types"));
|
||||||
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(AyaType).ToString()), "All AyaNova object types"));
|
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(AyaType).ToString()), "All AyaNova object types"));
|
||||||
ret.Add(new KeyValuePair<string, string>("Core", "All Core AyaNova business object types"));
|
ret.Add(new KeyValuePair<string, string>("Core", "All Core AyaNova business object types"));
|
||||||
@@ -169,23 +171,43 @@ namespace AyaNova.Api.Controllers
|
|||||||
}
|
}
|
||||||
else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(UserType).ToString()).ToLowerInvariant())
|
else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(UserType).ToString()).ToLowerInvariant())
|
||||||
{
|
{
|
||||||
TranslationKeysToFetch.Add("UserTypeAdministrator");
|
|
||||||
TranslationKeysToFetch.Add("UserTypeService");
|
TranslationKeysToFetch.Add("UserTypeService");
|
||||||
TranslationKeysToFetch.Add("UserTypeNotService");
|
TranslationKeysToFetch.Add("UserTypeNotService");
|
||||||
TranslationKeysToFetch.Add("UserTypeCustomer");
|
TranslationKeysToFetch.Add("UserTypeCustomer");
|
||||||
TranslationKeysToFetch.Add("UserTypeHeadOffice");
|
TranslationKeysToFetch.Add("UserTypeHeadOffice");
|
||||||
TranslationKeysToFetch.Add("UserTypeServiceContractor");
|
TranslationKeysToFetch.Add("UserTypeServiceContractor");
|
||||||
TranslationKeysToFetch.Add("UserTypeUtility");
|
|
||||||
var LT = await TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, translationId);
|
var LT = await TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, translationId);
|
||||||
|
|
||||||
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeAdministrator"], Id = (long)UserType.Administrator });
|
|
||||||
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeService"], Id = (long)UserType.Service });
|
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeService"], Id = (long)UserType.Service });
|
||||||
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeNotService"], Id = (long)UserType.NotService });
|
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeNotService"], Id = (long)UserType.NotService });
|
||||||
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeCustomer"], Id = (long)UserType.Customer });
|
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeCustomer"], Id = (long)UserType.Customer });
|
||||||
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeHeadOffice"], Id = (long)UserType.HeadOffice });
|
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeHeadOffice"], Id = (long)UserType.HeadOffice });
|
||||||
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeUtility"], Id = (long)UserType.Utility });
|
|
||||||
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeServiceContractor"], Id = (long)UserType.ServiceContractor });
|
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeServiceContractor"], Id = (long)UserType.ServiceContractor });
|
||||||
}
|
}
|
||||||
|
else if (keyNameInLowerCase == "insideusertype")
|
||||||
|
{
|
||||||
|
|
||||||
|
TranslationKeysToFetch.Add("UserTypeService");
|
||||||
|
TranslationKeysToFetch.Add("UserTypeNotService");
|
||||||
|
TranslationKeysToFetch.Add("UserTypeServiceContractor");
|
||||||
|
var LT = await TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, translationId);
|
||||||
|
|
||||||
|
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeService"], Id = (long)UserType.Service });
|
||||||
|
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeNotService"], Id = (long)UserType.NotService });
|
||||||
|
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeServiceContractor"], Id = (long)UserType.ServiceContractor });
|
||||||
|
}
|
||||||
|
else if (keyNameInLowerCase == "outsideusertype")
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
TranslationKeysToFetch.Add("UserTypeCustomer");
|
||||||
|
TranslationKeysToFetch.Add("UserTypeHeadOffice");
|
||||||
|
var LT = await TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, translationId);
|
||||||
|
|
||||||
|
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeCustomer"], Id = (long)UserType.Customer });
|
||||||
|
ReturnList.Add(new NameIdItem() { Name = LT["UserTypeHeadOffice"], Id = (long)UserType.HeadOffice });
|
||||||
|
}
|
||||||
else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(AyaEvent).ToString()).ToLowerInvariant())
|
else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(AyaEvent).ToString()).ToLowerInvariant())
|
||||||
{
|
{
|
||||||
TranslationKeysToFetch.Add("EventDeleted");
|
TranslationKeysToFetch.Add("EventDeleted");
|
||||||
@@ -355,7 +377,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ReturnList.Add(new NameIdItem() { Name = $"Unknown enum type list key value {enumKey}", Id = (long)UserType.Administrator });
|
ReturnList.Add(new NameIdItem() { Name = $"Unknown enum type list key value {enumKey}", Id = 0 });
|
||||||
}
|
}
|
||||||
|
|
||||||
return ReturnList;
|
return ReturnList;
|
||||||
|
|||||||
@@ -262,11 +262,60 @@ namespace AyaNova.Api.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private bool UserExists(long id)
|
/// <summary>
|
||||||
|
/// Get list of Users
|
||||||
|
/// (rights to User object required)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>All "inside" Users (except Customer and HeadOffice type)</returns>
|
||||||
|
[HttpGet("list")]
|
||||||
|
public async Task<IActionResult> GetInsideUserList()
|
||||||
{
|
{
|
||||||
return ct.User.Any(z => z.Id == id);
|
if (serverState.IsClosed)
|
||||||
|
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||||
|
|
||||||
|
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.User))
|
||||||
|
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||||
|
|
||||||
|
|
||||||
|
var ret = await ct.User.Where(z => z.UserType != UserType.Customer && z.UserType != UserType.HeadOffice).Select(z => new dtUser
|
||||||
|
{
|
||||||
|
Id = z.Id,
|
||||||
|
Active = z.Active,
|
||||||
|
Name = z.Name,
|
||||||
|
Roles = z.Roles,
|
||||||
|
UserType = z.UserType,
|
||||||
|
EmployeeNumber = z.EmployeeNumber,
|
||||||
|
LastLogin = z.LastLogin
|
||||||
|
|
||||||
|
}).ToListAsync();
|
||||||
|
return Ok(ApiOkResponse.Response(ret));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get list of Customer / Head office Users
|
||||||
|
/// (Rights to Customer object required)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>All "outside" Users (No staff or contractors)</returns>
|
||||||
|
[HttpGet("outlist")]
|
||||||
|
public async Task<IActionResult> GetOutsideUserList()
|
||||||
|
{
|
||||||
|
if (serverState.IsClosed)
|
||||||
|
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||||
|
|
||||||
|
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.Customer))
|
||||||
|
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||||
|
|
||||||
|
var ret = await ct.User.Where(z => z.UserType == UserType.Customer || z.UserType == UserType.HeadOffice).Select(z => new dtUser
|
||||||
|
{
|
||||||
|
Id = z.Id,
|
||||||
|
Active = z.Active,
|
||||||
|
Name = z.Name,
|
||||||
|
UserType = z.UserType,
|
||||||
|
LastLogin = z.LastLogin
|
||||||
|
|
||||||
|
}).ToListAsync();
|
||||||
|
return Ok(ApiOkResponse.Response(ret));
|
||||||
|
}
|
||||||
|
|
||||||
//------------
|
//------------
|
||||||
|
|
||||||
|
|||||||
@@ -1,138 +1,140 @@
|
|||||||
using System.Collections.Generic;
|
//##### DEPRECATED, using fixed list in UserController now
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using AyaNova.Biz;
|
|
||||||
namespace AyaNova.DataList
|
|
||||||
{
|
|
||||||
internal class UserDataList : AyaDataList
|
|
||||||
{
|
|
||||||
|
|
||||||
public UserDataList()
|
// using System.Collections.Generic;
|
||||||
{
|
// using Newtonsoft.Json.Linq;
|
||||||
DefaultListObjectType = AyaType.User;
|
// using AyaNova.Biz;
|
||||||
SQLFrom = "from auser";
|
// namespace AyaNova.DataList
|
||||||
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
|
// {
|
||||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
// internal class UserDataList : AyaDataList
|
||||||
|
// {
|
||||||
|
|
||||||
//Default ListView
|
// public UserDataList()
|
||||||
dynamic dlistView = new JArray();
|
// {
|
||||||
|
// DefaultListObjectType = AyaType.User;
|
||||||
|
// SQLFrom = "from auser";
|
||||||
|
// var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
|
||||||
|
// AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||||
|
|
||||||
dynamic cm = new JObject();
|
// //Default ListView
|
||||||
cm.fld = "username";
|
// dynamic dlistView = new JArray();
|
||||||
dlistView.Add(cm);
|
|
||||||
|
|
||||||
cm = new JObject();
|
// dynamic cm = new JObject();
|
||||||
cm.fld = "useremployeenumber";
|
// cm.fld = "username";
|
||||||
dlistView.Add(cm);
|
// dlistView.Add(cm);
|
||||||
|
|
||||||
cm = new JObject();
|
// cm = new JObject();
|
||||||
cm.fld = "usertype";
|
// cm.fld = "useremployeenumber";
|
||||||
dlistView.Add(cm);
|
// dlistView.Add(cm);
|
||||||
|
|
||||||
cm = new JObject();
|
// cm = new JObject();
|
||||||
cm.fld = "useractive";
|
// cm.fld = "usertype";
|
||||||
dlistView.Add(cm);
|
// dlistView.Add(cm);
|
||||||
|
|
||||||
cm = new JObject();
|
|
||||||
cm.fld = "userlastlogin";
|
|
||||||
dlistView.Add(cm);
|
|
||||||
|
|
||||||
cm = new JObject();
|
// cm = new JObject();
|
||||||
cm.fld = "userroles";
|
// cm.fld = "useractive";
|
||||||
dlistView.Add(cm);
|
// dlistView.Add(cm);
|
||||||
|
|
||||||
|
// cm = new JObject();
|
||||||
|
// cm.fld = "userlastlogin";
|
||||||
|
// dlistView.Add(cm);
|
||||||
|
|
||||||
|
// cm = new JObject();
|
||||||
|
// cm.fld = "userroles";
|
||||||
|
// dlistView.Add(cm);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
|
// 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
|
// //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>();
|
// FieldDefinitions = new List<AyaDataListFieldDefinition>();
|
||||||
//DPRECATED FieldDefinitions.Add(new AyaDataListFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.User, SqlIdColumnName = "auser.id" });
|
// //DPRECATED FieldDefinitions.Add(new AyaDataListFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.User, SqlIdColumnName = "auser.id" });
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
// FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
{
|
// {
|
||||||
TKey = "User",
|
// TKey = "User",
|
||||||
FieldKey = "username",
|
// FieldKey = "username",
|
||||||
AyaObjectType = (int)AyaType.User,
|
// AyaObjectType = (int)AyaType.User,
|
||||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
// UiFieldDataType = (int)UiFieldDataType.Text,
|
||||||
SqlIdColumnName = "auser.id",
|
// SqlIdColumnName = "auser.id",
|
||||||
SqlValueColumnName = "auser.name",
|
// SqlValueColumnName = "auser.name",
|
||||||
IsRowId = true
|
// IsRowId = true
|
||||||
});
|
// });
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
// FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
{
|
// {
|
||||||
TKey = "Active",
|
// TKey = "Active",
|
||||||
FieldKey = "useractive",
|
// FieldKey = "useractive",
|
||||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
// UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||||
SqlValueColumnName = "auser.active"
|
// SqlValueColumnName = "auser.active"
|
||||||
});
|
// });
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
// FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
{
|
// {
|
||||||
TKey = "AuthorizationRoles",
|
// TKey = "AuthorizationRoles",
|
||||||
FieldKey = "userroles",
|
// FieldKey = "userroles",
|
||||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
// UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||||
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(AuthorizationRoles).ToString()),
|
// EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(AuthorizationRoles).ToString()),
|
||||||
SqlValueColumnName = "auser.roles"
|
// SqlValueColumnName = "auser.roles"
|
||||||
});
|
// });
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
// FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
{
|
// {
|
||||||
TKey = "LastLogin",
|
// TKey = "LastLogin",
|
||||||
FieldKey = "userlastlogin",
|
// FieldKey = "userlastlogin",
|
||||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
// UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||||
SqlValueColumnName = "auser.lastlogin"
|
// SqlValueColumnName = "auser.lastlogin"
|
||||||
});
|
// });
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
// FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
{
|
// {
|
||||||
TKey = "UserType",
|
// TKey = "UserType",
|
||||||
FieldKey = "usertype",
|
// FieldKey = "usertype",
|
||||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
// UiFieldDataType = (int)UiFieldDataType.Enum,
|
||||||
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(UserType).ToString()),
|
// EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(UserType).ToString()),
|
||||||
SqlValueColumnName = "auser.usertype"
|
// SqlValueColumnName = "auser.usertype"
|
||||||
});
|
// });
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
// FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
{
|
// {
|
||||||
TKey = "UserEmployeeNumber",
|
// TKey = "UserEmployeeNumber",
|
||||||
FieldKey = "useremployeenumber",
|
// FieldKey = "useremployeenumber",
|
||||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
// UiFieldDataType = (int)UiFieldDataType.Text,
|
||||||
SqlValueColumnName = "auser.employeenumber"
|
// SqlValueColumnName = "auser.employeenumber"
|
||||||
});
|
// });
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
// FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
{
|
// {
|
||||||
TKey = "UserNotes",
|
// TKey = "UserNotes",
|
||||||
FieldKey = "usernotes",
|
// FieldKey = "usernotes",
|
||||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
// UiFieldDataType = (int)UiFieldDataType.Text,
|
||||||
SqlValueColumnName = "auser.notes"
|
// SqlValueColumnName = "auser.notes"
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
|
||||||
// //-------------------------
|
// // //-------------------------
|
||||||
//NOT SURE ABOUT CUSTOM FIELDS
|
// //NOT SURE ABOUT CUSTOM FIELDS
|
||||||
//NEED TO COME BACK TO THIS ONCE CLIENT IS CONSUMING THESE LISTS
|
// //NEED TO COME BACK TO THIS ONCE CLIENT IS CONSUMING THESE LISTS
|
||||||
//WIDGETLIST has custom fields so good test before doing here
|
// //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 = "WidgetCustom1", FieldKey = "widgetcustom1", IsCustomField = true });
|
||||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom2", FieldKey = "widgetcustom2", 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 = "WidgetCustom3", FieldKey = "widgetcustom3", IsCustomField = true });
|
||||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom4", FieldKey = "widgetcustom4", 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 = "WidgetCustom5", FieldKey = "widgetcustom5", IsCustomField = true });
|
||||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom6", FieldKey = "widgetcustom6", 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 = "WidgetCustom7", FieldKey = "widgetcustom7", IsCustomField = true });
|
||||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom8", FieldKey = "widgetcustom8", 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 = "WidgetCustom9", FieldKey = "widgetcustom9", IsCustomField = true });
|
||||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom10", FieldKey = "widgetcustom10", 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 = "WidgetCustom11", FieldKey = "widgetcustom11", IsCustomField = true });
|
||||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom12", FieldKey = "widgetcustom12", 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 = "WidgetCustom13", FieldKey = "widgetcustom13", IsCustomField = true });
|
||||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom14", FieldKey = "widgetcustom14", 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 = "WidgetCustom15", FieldKey = "widgetcustom15", IsCustomField = true });
|
||||||
// FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom16", FieldKey = "widgetcustom16", IsCustomField = true });
|
// // FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetCustom16", FieldKey = "widgetcustom16", IsCustomField = true });
|
||||||
}
|
// }
|
||||||
}//eoc
|
// }//eoc
|
||||||
}//eons
|
// }//eons
|
||||||
@@ -31,7 +31,7 @@ namespace AyaNova.Biz
|
|||||||
u.Roles = AuthorizationRoles.All;//AuthorizationRoles.BizAdminFull | AuthorizationRoles.OpsAdminFull | AuthorizationRoles.DispatchFull | AuthorizationRoles.InventoryFull;
|
u.Roles = AuthorizationRoles.All;//AuthorizationRoles.BizAdminFull | AuthorizationRoles.OpsAdminFull | AuthorizationRoles.DispatchFull | AuthorizationRoles.InventoryFull;
|
||||||
|
|
||||||
|
|
||||||
u.UserType = UserType.Administrator;
|
u.UserType = UserType.NotService;
|
||||||
u.UserOptions = new UserOptions();
|
u.UserOptions = new UserOptions();
|
||||||
u.UserOptions.TranslationId = ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID;//Ensure primeTranslations is called first
|
u.UserOptions.TranslationId = ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID;//Ensure primeTranslations is called first
|
||||||
await ct.User.AddAsync(u);
|
await ct.User.AddAsync(u);
|
||||||
|
|||||||
@@ -4,13 +4,11 @@ namespace AyaNova.Biz
|
|||||||
/// AyaNova User types
|
/// AyaNova User types
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum UserType : int
|
public enum UserType : int
|
||||||
{
|
{
|
||||||
Administrator = 1,
|
Service = 1,
|
||||||
Service = 2,
|
NotService = 2,
|
||||||
NotService = 3,
|
Customer = 3,
|
||||||
Customer = 4,
|
HeadOffice = 4,
|
||||||
HeadOffice = 5,
|
ServiceContractor = 5
|
||||||
Utility = 6,
|
|
||||||
ServiceContractor = 7
|
|
||||||
}
|
}
|
||||||
}//eons
|
}//eons
|
||||||
|
|||||||
@@ -530,9 +530,9 @@ namespace AyaNova.Util
|
|||||||
await GenSeedUserAsync(log, 1, AuthorizationRoles.OpsAdminLimited, UserType.NotService, false, "TEST_INACTIVE", "TEST_INACTIVE", 0, KnownUserTags);
|
await GenSeedUserAsync(log, 1, AuthorizationRoles.OpsAdminLimited, UserType.NotService, false, "TEST_INACTIVE", "TEST_INACTIVE", 0, KnownUserTags);
|
||||||
|
|
||||||
//Alternate translation users for each stock translation
|
//Alternate translation users for each stock translation
|
||||||
await GenSeedUserAsync(log, 1, AuthorizationRoles.All, UserType.Administrator, true, "de", "de", await TranslationBiz.TranslationNameToIdStaticAsync("de"), KnownUserTags);
|
await GenSeedUserAsync(log, 1, AuthorizationRoles.All, UserType.NotService, true, "de", "de", await TranslationBiz.TranslationNameToIdStaticAsync("de"), KnownUserTags);
|
||||||
await GenSeedUserAsync(log, 1, AuthorizationRoles.All, UserType.Administrator, true, "es", "es", await TranslationBiz.TranslationNameToIdStaticAsync("es"), KnownUserTags);
|
await GenSeedUserAsync(log, 1, AuthorizationRoles.All, UserType.NotService, true, "es", "es", await TranslationBiz.TranslationNameToIdStaticAsync("es"), KnownUserTags);
|
||||||
await GenSeedUserAsync(log, 1, AuthorizationRoles.All, UserType.Administrator, true, "fr", "fr", await TranslationBiz.TranslationNameToIdStaticAsync("fr"), KnownUserTags);
|
await GenSeedUserAsync(log, 1, AuthorizationRoles.All, UserType.NotService, true, "fr", "fr", await TranslationBiz.TranslationNameToIdStaticAsync("fr"), KnownUserTags);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user