Class PermissionErrorMessageUtil
- java.lang.Object
-
- com.flowable.platform.service.permission.PermissionErrorMessageUtil
-
public class PermissionErrorMessageUtil extends Object
This utility helps creating template based permission (authorization) error messages.- Author:
- Micha Kiener
-
-
Field Summary
Fields Modifier and Type Field Description static String
PERMISSION_ERROR_CODES_TEMPLATE_KEY
The template definition key used for permission (authorization) error messages.static String
VARIANT_KEY_ERROR_CODE
static String
VARIANT_KEY_LANGUAGE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
createPermissionErrorMessage(String tenantId, String errorCode, String language, Map<String,Object> payload)
Creates a permission error message based on the provided error code and payload.static String
createPermissionErrorMessage(String tenantId, String errorCode, Map<String,Object> payload)
Creates a permission error message based on the provided error code and payload.
-
-
-
Field Detail
-
PERMISSION_ERROR_CODES_TEMPLATE_KEY
public static final String PERMISSION_ERROR_CODES_TEMPLATE_KEY
The template definition key used for permission (authorization) error messages.- See Also:
- Constant Field Values
-
VARIANT_KEY_ERROR_CODE
public static final String VARIANT_KEY_ERROR_CODE
- See Also:
- Constant Field Values
-
VARIANT_KEY_LANGUAGE
public static final String VARIANT_KEY_LANGUAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
createPermissionErrorMessage
public static String createPermissionErrorMessage(String tenantId, String errorCode, Map<String,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 theTemplateVariationModel
. This one uses english as the default language.- Parameters:
errorCode
- the error code to choose the template variation forpayload
- the optional payload containing the necessary parameters (if any needed by the template)- Returns:
- the rendered permission error message
-
createPermissionErrorMessage
public static String createPermissionErrorMessage(String tenantId, String errorCode, String language, Map<String,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 theTemplateVariationModel
.- Parameters:
errorCode
- the error code to choose the template variation forlanguage
- the language (e.g. "en") for which the message should be renderedpayload
- the optional payload containing the necessary parameters (if any needed by the template)- Returns:
- the rendered permission error message
-
-