Class TaskModes

java.lang.Object
ch.tocco.nice2.businessunit.api.TaskModes

public final class TaskModes extends Object
  • Field Details

    • BUSINESS_UNIT

      public static final Mode.Key<BusinessUnit> BUSINESS_UNIT
      Specifies the business unit that is used to execute a persist task. The business unit is changed using BusinessUnitManager.switchBusinessUnit(BusinessUnit, boolean) and resetted after the task has been executed. When the privileged mode is also active (see `SecModes#PRIVLEGED`), the principal is not logged into the new business unit.
    • BUSINESS_UNIT_ID

      public static final Mode.Key<String> BUSINESS_UNIT_ID
      Equal behaviour as BUSINESS_UNIT but you can pass the unique id of the business unit instead of the class BusinessUnit
    • NO_BUSINESS_UNIT_INTERCEPT

      public static final Mode.Key<Boolean> NO_BUSINESS_UNIT_INTERCEPT
      Unsets the business unit to BusinessUnit.NULL_BUSINESS_UNIT, but does not a re-login. The permissions are unchanged for the current principal, but queries are not intercepted for a bussiness unit and entities are not automatically linked to a business unit. Note, that counters for business unit aware entities are _not_ working with this mode.