Class PermissionErrorMessageUtil

java.lang.Object
com.flowable.platform.service.permission.PermissionErrorMessageUtil

public class PermissionErrorMessageUtil
extends java.lang.Object
This utility helps creating template based permission (authorization) error messages.
Author:
Micha Kiener
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String PERMISSION_ERROR_CODES_TEMPLATE_KEY
    The template definition key used for permission (authorization) error messages.
    static java.lang.String VARIANT_KEY_ERROR_CODE  
    static java.lang.String VARIANT_KEY_LANGUAGE  
  • Method Summary

    Modifier and Type Method Description
    static java.lang.String createPermissionErrorMessage​(java.lang.String tenantId, java.lang.String errorCode, java.lang.String language, java.util.Map<java.lang.String,​java.lang.Object> payload)
    Creates a permission error message based on the provided error code and payload.
    static java.lang.String createPermissionErrorMessage​(java.lang.String tenantId, java.lang.String errorCode, java.util.Map<java.lang.String,​java.lang.Object> payload)
    Creates a permission error message based on the provided error code and payload.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • createPermissionErrorMessage

      public static java.lang.String createPermissionErrorMessage​(java.lang.String tenantId, java.lang.String errorCode, java.util.Map<java.lang.String,​java.lang.Object> payload)
      Creates a permission error message based on the provided error code and payload. The payload must at least contain the necessary parameters as being defined within the TemplateVariationModel. This one uses english as the default language.
      Parameters:
      errorCode - the error code to choose the template variation for
      payload - the optional payload containing the necessary parameters (if any needed by the template)
      Returns:
      the rendered permission error message
    • createPermissionErrorMessage

      public static java.lang.String createPermissionErrorMessage​(java.lang.String tenantId, java.lang.String errorCode, java.lang.String language, java.util.Map<java.lang.String,​java.lang.Object> payload)
      Creates a permission error message based on the provided error code and payload. The payload must at least contain the necessary parameters as being defined within the TemplateVariationModel.
      Parameters:
      errorCode - the error code to choose the template variation for
      language - the language (e.g. "en") for which the message should be rendered
      payload - the optional payload containing the necessary parameters (if any needed by the template)
      Returns:
      the rendered permission error message