AnsweredAssumed Answered

nativeUser property - what is it?

Question asked by chrisokelly on Oct 22, 2012
Hi all,

I notice in the userprofile webscripts in share the user object's nativeUser property is used for quite a few tasks. I am currently attempting (with great difficulty) to add properties to the user object in alfresco. I have managed to add an aspect to all users and that aspect defines two properties - cl_extension and cl_mobile. When I view my own profile the nativeUser object contains my extended properties, I pass their values to the freemarker template and the user profile page works fine. However, when viewing someone else's profile they are always 'null'. I added some logging and found that when on someone else's profile, although the other properties (like telephone, userStatus, id and organization) are correctly populated, my two custom properties are always the string: "null".

In the javascript console, I can enter the following -
user=people.getPerson("username");
print(user.properties["cl_extension"]);
and the proper extension is shown, so I know the property has been properly set.

The whole thing is made difficult by the fact that there is no documentation whatsoever (unless it is a closely guarded secret) on the getUser method besides the ultimately unhelpful http://docs.alfresco.com/4.0/topic/com.alfresco.enterprise.doc/references/APISurf-ScriptUser-getUser.html or the returned nativeUser object (great, it returns the underlying user object, how about some of the logic, like what is behind the properties which cannot be viewed by other users?).

Is there any plans in future releases to make the user object more readily extensible? It is already really simple to extend the content type and add searchable properties for files or folders. Why is it that there is no process or documentation whatsoever for accomplishing the same for the user type in recent versions? It seems ridiculous that we have to investigate third party software for a contact list when we have a complex system like Alfresco already running.

Outcomes