cancel
Showing results for 
Search instead for 
Did you mean: 

how can make the customized java node running under the admi

forrest43
Champ in-the-making
Champ in-the-making
we have defined a custom process in alfresco.when the process starts,the process instance will cross the custom java node and create some files in alfresco repository.
when we use another account(not admin) to start the process,the java node will throw an exception and try to tell me do not have an exception and try to tell me do not have enough power to execute some api.how can make the customized java node running under the admin authority instead of the current process creator
1 REPLY 1

dantuffery
Champ in-the-making
Champ in-the-making
If you put this around your code it will run as the admin user.



AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Object>() {
    @Override
    public Object doWork() throws Exception {
        //Your code goes here
        return null;
    }
}, "admin");