How to get current logged in user and add to custom document action url

cancel
Showing results for 
Search instead for 
Did you mean: 
jasonzhang
Member II

How to get current logged in user and add to custom document action url

Hello,

My target is to get the current logged in username and add it to a custom document action url. I think I can modify the actions.js file by adding custom function to access surf root object "user" like user.fullName, and then put a placeholder in share-documentlibrary-config.xml to make the custom action url, but using "var x = ${user.fullName} in actions.js returns "not defined" error message. It seems like ${user.fullName} can be only used in .ftl FreeMarker template file as a variable to access surf root objects. 

https://docs.alfresco.com/6.1/references/APISurf-rootscoped.html

Is there anyway I can implement this function?

Thank you