This commit is contained in:
2018-11-12 23:34:47 +00:00
parent f1fe285fd5
commit 9b5c4094b5
3 changed files with 15 additions and 4 deletions

View File

@@ -330,6 +330,13 @@ namespace AyaNova.Util
//TEST NOT ACTIVE - this is used for a test to see if inactive user can login
GenSeedUser(log, 1, AuthorizationRoles.OpsAdminLimited, UserType.NonSchedulable, false, "TEST_INACTIVE", "TEST_INACTIVE");
//Alternate locale users for each stock locale
GenSeedUser(log, 1, AuthorizationRoles.BizAdminFull, UserType.Administrator, true, "de", "de", LocaleBiz.LocaleNameToIdStatic("de"));
GenSeedUser(log, 1, AuthorizationRoles.BizAdminFull, UserType.Administrator, true, "es", "es", LocaleBiz.LocaleNameToIdStatic("es"));
GenSeedUser(log, 1, AuthorizationRoles.BizAdminFull, UserType.Administrator, true, "fr", "fr", LocaleBiz.LocaleNameToIdStatic("fr"));
}
catch
{
@@ -364,7 +371,7 @@ namespace AyaNova.Util
public static void GenSeedUser(ILogger log, int count, AuthorizationRoles roles, UserType userType, bool active = true, string login = null, string password = null)
public static void GenSeedUser(ILogger log, int count, AuthorizationRoles roles, UserType userType, bool active = true, string login = null, string password = null, long localeId = 0)
{
UserBiz Biz = UserBiz.GetBizInternal(ServiceProviderProvider.DBContext);
@@ -392,7 +399,7 @@ namespace AyaNova.Util
else
u.Password = u.Login;
u.Roles = roles;
u.LocaleId = ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID;
u.LocaleId = localeId == 0 ? ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID : localeId;
u.UserType = userType;
//TODO: After have USER and HEADOFFICE and VENDOR, if usertype is subcontractor or client or headoffice it needs to set a corresponding user's parent org record id to go with it