This commit is contained in:
@@ -72,6 +72,8 @@ IMPORTMAP
|
||||
NOTES FOR DOCS
|
||||
- Only an empty database is supported for import
|
||||
- Only one shot import, can't import again later
|
||||
- LOCALES
|
||||
- MUST be a default locale set before import because new raven keys will be added to imported v7 locale using the default locale only
|
||||
- IMPORTED USERS
|
||||
- login and passwords are not imported and need to be setup again after import
|
||||
- no Authorization Role is set and therefore no rights to anything. A role needs to be set after import for each user
|
||||
|
||||
@@ -437,6 +437,13 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
|
||||
//Now add keys that were added after v7 for RAVEN using default locale values
|
||||
foreach(string s in ValidKeys){
|
||||
if(!NewLocaleDict.ContainsKey(s)){
|
||||
NewLocaleDict.Add(s,GetDefaultLocalizedText(s).Result);
|
||||
}
|
||||
}
|
||||
|
||||
//Validate it's the correct number of keys expected
|
||||
if (NewLocaleDict.Count != ValidKeys.Count)
|
||||
{
|
||||
|
||||
@@ -415,6 +415,14 @@ namespace AyaNova.Biz
|
||||
{
|
||||
var V7Id = new Guid(j["ID"].Value<string>());
|
||||
|
||||
//skip the administrator account but add it to the map for all the other import code that requires it
|
||||
if (V7Id == new Guid("2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed"))
|
||||
{
|
||||
var mapItem = new ImportAyaNova7MapItem(V7Id, AyaType.User, 1);
|
||||
importMap.Add(mapItem);
|
||||
return true;
|
||||
}
|
||||
|
||||
//Copy values
|
||||
User i = new User();
|
||||
i.Name = j["FirstName"].Value<string>() + " " + j["LastName"].Value<string>();
|
||||
@@ -438,7 +446,10 @@ namespace AyaNova.Biz
|
||||
i.Password = Hasher.hash(i.Salt, Hasher.GenerateSalt());
|
||||
|
||||
//No rights
|
||||
i.Roles=AuthorizationRoles.NoRole;
|
||||
i.Roles = AuthorizationRoles.NoRole;
|
||||
|
||||
//temporary locale id to satisfy db settings
|
||||
i.LocaleId = ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID;
|
||||
|
||||
User o = await CreateAsync(i);
|
||||
if (HasErrors)
|
||||
|
||||
Reference in New Issue
Block a user