REPO-1530: Create Person - enabled flag should be optional

- Added default value true for enable on create person and fixed test

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@132727 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Raluca Munteanu
2016-11-14 09:13:08 +00:00
parent 7e89c53fe8
commit 62e90cd0a8
2 changed files with 8 additions and 3 deletions

View File

@@ -393,7 +393,14 @@ public class PeopleImpl implements People
{
throw new ConstraintViolatedException("Person '"+person.getUserName()+"' already exists.");
}
Map<QName, Serializable> props = person.toProperties();
// set enabled default value true
if (person.isEnabled() == null)
{
person.setEnabled(true);
}
Map<QName, Serializable> props = person.toProperties();
MutableAuthenticationService mas = (MutableAuthenticationService) authenticationService;
mas.createAuthentication(person.getUserName(), person.getPassword().toCharArray());
@@ -437,7 +444,6 @@ public class PeopleImpl implements People
checkRequiredField("id", person.getUserName());
checkRequiredField("firstName", person.getFirstName());
checkRequiredField("email", person.getEmail());
checkRequiredField("enabled", person.isEnabled());
checkRequiredField("password", person.getPassword());
}