cancel
Showing results for 
Search instead for 
Did you mean: 

get current user from actioncontext in javascript

bvsoest
Champ in-the-making
Champ in-the-making
Hi,

I need some help accomplishing the following:

I created a custom action, Subscribe, and added it to the space menu. This action triggers a javascript and gets actionContext.id as it's parameter. Using search.findnode I can find the node.
In the script I would also like to get the current user.
How can I do this?
Where can I find more info about the actionContext object.
Can I pass other (actionObject) properties, i.e. current user, as a parameter.
What I need eventually is e-mail subscription functionality with which a user can subscribe himself to a space

Thanks in advance for any info!
Regards, Berno.
1 REPLY 1

kevinr
Star Contributor
Star Contributor
There is an object in the default script model called 'person' - it represents the current user node - see the javascript API docs for info on the objects available.

You can pass values from the actionContext node such as a property value e.g. actionContext.properties["cm:description"].

Thanks,

Kevin