cancel
Showing results for 
Search instead for 
Did you mean: 

execute a script as admin

cpichon
Champ in-the-making
Champ in-the-making
hello,

I have a java script  which is trigged when an outbound event occurs.
For a question of rights on contents,  I want this script to be executed as if it was "admin" user connected even if the current connected user is anyone else.

Is this possible ?
Thanks in advance

Christophe
1 REPLY 1

damiar
Champ in-the-making
Champ in-the-making
Yep, it is possible.
You need to get an 'admin' ticket and then send it to the webscript you want to execute.


http://wiki.alfresco.com/wiki/2.1_REST_API#Login
http://wiki.alfresco.com/wiki/Web_Scripts#Authenticating


So, first you get a ticket making a call like this:
GET /alfresco/service/api/login?u={adminUsername}&pw={adminPassword}

And then you call your webscript like this:
http://<host>:<port>/<contextPath>/<servicePath>/yourServce?alf_ticket=<ticket>