Merged 5.2.0 (5.2.0) to HEAD (5.2)

132727 rmunteanu: 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/HEAD/root@133360 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-12-06 16:59:27 +00:00
parent f5187ac0e8
commit 5d6c9aa7b0
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());
}