Run dashlet as admin not working

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

Run dashlet as admin not working

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;
1 Reply
sanjaybandhniya
Intermediate

Re: Run dashlet as admin not working

Hi,

The runas attribute allows a web script developer to state that the execution of a web script must run as a particular repository user, regardless of who initiated the web script.
This is useful where the behavior of the web script requires specific permissions to succeed. Due to security concerns, the runas attribute is only available for web script implementations placed into the Java classpath.

It state that repository tier webscript,you can make run as admin not share tier webscript.

Dashlet is part of share.

Thanks,

Sanjay