AnsweredAssumed Answered

Changing a Username in Alfresco

Question asked by smrcpits on May 6, 2011
I am part of a team developing a connector for Alfresco which needs to be able to manipulate user accounts within Alfresco programmatically. To do this, we have been using the AdministrationServiceSoapBindingStub class and its createUsers, deleteUsers, getUser, and updateUsers methods. This seems to work for everything we need except changing the username of a user. If I call getUser and provide the old username, modify the returned UserDetails object to now contain the new username, and then send back the now modified UserDetails object using updateUsers, the updateUsers call just hangs and never returns. Some searching around on these forums seems to indicate that there is no supported way to directly modify a username.

The next best option that I can find is to delete the old username, create a new user, and the change the associations (e.g. owner, creator, etc) of all the content that used to be associated with the old username to now be associated with the new one. Is this really the only way to go about this or have I overlooked a better option? And if so, has anyone done this before who might have a complete list of places to look within the node structure for content that needs to be re-associated? I've already made some preliminary attempts to do so using both the methods of the RepositoryServiceSoapBindingStub class as well as direct edits to the sql database, both with disastrous results. Any advice on this matter would be appreciated.

Outcomes