AnsweredAssumed Answered

How to create a New User through JavaScript API ?

Question asked by alexr on Dec 27, 2007
Latest reply on Dec 28, 2007 by alexr
Hi Kevin and colleague Alfresco developers,

At this moment I am trying to create a new user (cm:person) with the Alfresco JavaScript API.
The people API would seem the most logical, however it doesn't
have a createUser method.
I don't know if a cm:person is considered a "Node", but I tried to
create a new person with the createNode method on person.parent

The object person (logged on user) was the "admin" user when
testing the script below:

    props = new Array(6);
    props["cm:userName"] = "test";
    props["cm:firstName"] = "Test";
    props["cm:lastName"] = "User";
    props["cm:email"] =    "";
    props["cm:organizationId"] = "1234";
    props["cm:password"] = "test"
    //props["cm:homeFolder"] =;
    //props["cm:homeFolderProvider"] = "";
    var tstUser = person.parent.createNode(null, "cm:person", props);

Can anybody tell me what's wrong with the above code snippet and how the syntax for creating a new user would look like?

Kind regards,