I can't get my dashlet webscript to run as admin. It just runs as which ever user loads the page and if that user is not an alfresco administrator it fails with the following error. I have my webscript baked into and installed amp. I'm on version 5.1
ERROR [extensions.webscripts.AbstractRuntime] [http-apr-8080-exec-19] Exception from executeScript - redirecting to status template error: 04030001 Wrapped Exception (with status template): 04031852 Accessing task with id='activiti$466543' is not allowed for user 'jojo'
Here is my desc.xml
<webscript>
<shortname>P1 Status Dashlet</shortname>
<description>Shows the status of active P1 Workflows</description>
<family>dashlet</family>
<url>/P1Status</url>
<authentication runas="admin">user</authentication>
</webscript>
and js
<import resource="classpath:/alfresco/templates/org/alfresco/import/alfresco-util.js">
var connector = remote.connect("alfresco");
var json = connector.get("/api/workflow-instances");
var obj = JSON.parse(json);
var wfs = obj.data;
for(var i = 0; i < wfs.length; i++)
{
var tasks = JSON.parse(connector.get('/api/workflow-instances/' + wfs[i].id + '?includeTasks=true'));
wfs[i].tasks = tasks.data.tasks;
wfs[i].startDate = AlfrescoUtil.fromISO8601(wfs[i].startDate);
for(var t in wfs[i].tasks)
{
wfs[i].tasks[t].properties.bpm_startDate = AlfrescoUtil.fromISO8601(wfs[i].tasks[t].properties.bpm_startDate);
}
}
model.workflows = wfs;