AnsweredAssumed Answered

Create user webscript - works but....

Question asked by iann on Feb 2, 2010
Latest reply on Feb 3, 2010 by iann
Hi,

I've created a simple webscript that creates users - below is a test sample. All work's well and i'm about to expand the functionality further, but I have an error whenever I try to delete a user that's been created using the script.

It is:

Unable to delete the User object associated with the Person. This is not an error if an external authentication mechanism such as NTLM was previously active.
Failed to delete User due to error: org.alfresco.repo.security.authentication.AuthenticationException: 01020006 User name does not exist: testuser@gmail.com


Any help would be greatly appreciated!
Thanks,

Ian

script:
{
model.firstName = "Test";
model.lastName = "User";
model.emailAddress = "testuser@gmail.com";

var user = people.createPerson(model.emailAddress);
user.properties["cm:firstName"] = model.firstName;
user.properties["cm:lastName"] = model.lastName;
user.properties["usr:password"] = "testtest";
user.save();
}

Outcomes