This commit is contained in:
@@ -50,7 +50,7 @@ namespace AyaNova.Biz
|
||||
InventoryFull | AccountingFull | TechLimited | TechFull | SubContractorLimited |
|
||||
SubContractorFull | ClientLimited | ClientFull | OpsAdminLimited | OpsAdminFull
|
||||
|
||||
}//end SecurityLevelTypes
|
||||
}//end AuthorizationRoles
|
||||
|
||||
}//end namespace GZTW.AyaNova.BLL
|
||||
|
||||
|
||||
@@ -36,6 +36,10 @@ namespace AyaNova.Biz
|
||||
//CREATE
|
||||
internal async Task<User> CreateAsync(User inObj)
|
||||
{
|
||||
//This is a new user so it will have been posted with a password in plaintext which needs to be salted and hashed
|
||||
inObj.Salt = Hasher.GenerateSalt();
|
||||
inObj.Password = Hasher.hash(inObj.Salt, inObj.Password);
|
||||
|
||||
Validate(inObj, true);
|
||||
if (HasErrors)
|
||||
return null;
|
||||
@@ -44,6 +48,8 @@ namespace AyaNova.Biz
|
||||
//do stuff with User
|
||||
User outObj = inObj;
|
||||
outObj.OwnerId = userId;
|
||||
|
||||
|
||||
//SearchHelper(break down text fields, save to db)
|
||||
//TagHelper(collection of tags??)
|
||||
await ct.User.AddAsync(outObj);
|
||||
@@ -317,8 +323,8 @@ namespace AyaNova.Biz
|
||||
AddError(ValidationErrorType.InvalidValue, "Roles");
|
||||
}
|
||||
|
||||
//Name must be less than 255 characters
|
||||
if (inObj.EmployeeNumber.Length > 255)
|
||||
//Optional employee number field must be less than 255 characters
|
||||
if (!string.IsNullOrWhiteSpace(inObj.EmployeeNumber) && inObj.EmployeeNumber.Length > 255)
|
||||
AddError(ValidationErrorType.LengthExceeded, "EmployeeNumber", "255 max");
|
||||
|
||||
|
||||
|
||||
@@ -18,8 +18,7 @@ namespace AyaNova.Models
|
||||
[Required]
|
||||
public string Login { get; set; }
|
||||
[Required]
|
||||
public string Password { get; set; }
|
||||
[Required]
|
||||
public string Password { get; set; }
|
||||
public string Salt { get; set; }
|
||||
[Required]
|
||||
public AuthorizationRoles Roles { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user