cancel
Showing results for 
Search instead for 
Did you mean: 

Custom evaluator - how to execute as system user?

csiege
Champ in-the-making
Champ in-the-making
Hi,

I have a custom evaluator for a custom action button.  I need to be able to do some checking inside that evaluator.

Apparantly the evaluator executes with the current users permissions.
I need to execute as the system user.

What is the best / easiest way to do that from within an evaluator?

The specific line I am failing on due to this is
permissionService.getAllSetPermissions(node.getNodeRef());

thanks!

Chris
2 REPLIES 2

csiege
Champ in-the-making
Champ in-the-making
Anyone… ?

kevinr
Star Contributor
Star Contributor
The org.alfresco.repo.security.authentication.AuthenticationUtil class has some useful methods for this sort of thing.

Amongst other things, you can call runAs() with a anonymous class of work to perform as the specified user.

Cheers,

Kevin