Class Sudo

java.lang.Object
ch.ivyteam.ivy.security.exec.Sudo

public final class Sudo extends Object

Executes code without permission checking.

You as process developer are responsible to check security permission of the current user in your process when using this method! Ensure that only authorized user can execute the process calling this method.

Use with care, since this can cause severe security problems!

Since:
9.3
API:
This is a public API.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> T
    call(Callable<T> callable)
    Executes the call method of the given Callable and returns the returned value.
    static void
    execute(Executable executable)
    Executes the execute method of the given Executable.
    static <T> T
    get(Supplier<T> supplier)
    Executes the get method of the given Supplier and returns the returned value.
    static void
    run(Runnable runnable)
    Executes the run method of the given Runnable.
  • Method Details

    • get

      public static <T> T get(Supplier<T> supplier)

      Executes the get method of the given Supplier and returns the returned value.

      Checking of permissions are disabled while calling the get method.

      You as process developer are responsible to check security permission of the current user in your process when using this method! Ensure that only authorized user can execute the process calling this method.

      Use with care, since this can cause severe security problems!

      Type Parameters:
      T -
      Parameters:
      supplier -
      Returns:
      value returned by the given supplier
      Since:
      9.3
      See Also:
      API:
      This public API is available in Java.
    • call

      public static <T> T call(Callable<T> callable) throws Exception

      Executes the call method of the given Callable and returns the returned value.

      Checking of permissions are disabled while calling the {Callable#call() call} method.

      You as process developer are responsible to check security permission of the current user in your process when using this method! Ensure that only authorized user can execute the process calling this method.

      Use with care, since this can cause severe security problems!

      Type Parameters:
      T -
      Parameters:
      callable -
      Returns:
      value returned by the given callable
      Throws:
      Exception - if execute method throws an Exception
      Since:
      9.3
      See Also:
      API:
      This public API is available in Java.
    • run

      public static void run(Runnable runnable)

      Executes the run method of the given Runnable.

      Checking of permissions are disabled while calling the {Runnable#run() run} method.

      You as process developer are responsible to check security permission of the current user in your process when using this method! Ensure that only authorized user can execute the process calling this method.

      Use with care, since this can cause severe security problems!

      Parameters:
      runnable -
      Since:
      9.3
      See Also:
      API:
      This public API is available in Java.
    • execute

      public static void execute(Executable executable) throws Exception

      Executes the execute method of the given Executable.

      Checking of permissions are disabled while calling the {Executable#execute() execute} method.

      You as process developer are responsible to check security permission of the current user in your process when using this method! Ensure that only authorized user can execute the process calling this method.

      Use with care, since this can cause severe security problems!

      Parameters:
      executable -
      Throws:
      Exception - if execute method throws an Exception
      Since:
      9.3
      See Also:
      API:
      This public API is available in Java.