I have a process that does some administrative tasks that requires a lot of Axon.ivy permissions. The user that executes the task does not own all of the required permissions.

But I as a process designer know what I do and I want to give the user the possibility to execute the administrative task without the necessary Axon.ivy permissions. I implement the security in the process itself by guarding the process start with a certain role for example.

How can I disable programmatically Axon.ivy Security/Permission checks?

asked 05.06.2014 at 09:39

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
accept rate: 74%

edited 22.05.2019 at 08:30

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦

Axon.ivy 7.0 and newer

There is a convenience checkbox on the 'Script Activity' below the code block which will turn of permission check completely. Just hit it and fire your administrative API call here.


All Versions

You can disable Xpert.ivy Security checks with the following code:

import java.util.concurrent.Callable;
import ch.ivyteam.ivy.server.ServerFactory;

public class AdministrationTask 
    public static void doAdminTask() throws Exception
        ServerFactory.getServer().getSecurityManager().executeAsSystem(new Callable<Void>(){
            public Void call() throws Exception {

                // Implement your code here. Permission checks are disabled in this method.

                return null;

Note that the method is called executeAsSystem(...). There is a similar method on the ISecurityContext called executeAsSystemUser(...). The difference between the two methods is that executeAsSystem(...) disables all permission checks whereas executeAsSystemUser(...) executes the code as user SYSTEM with permission checks enabled. With executeAsSystemUser(...) if the SYSTEM user does not own a necessary permission then Xpert.ivy will also throw a PermissionDeniedException. Whereas with executeAsSystem(...) no PermissionDeniedException will ever by thrown.


answered 05.06.2014 at 09:55

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
accept rate: 74%

edited 22.05.2019 at 08:04

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 05.06.2014 at 09:39

Seen: 3,639 times

Last updated: 22.05.2019 at 08:30