Class PermissionErrorMessageUtil
java.lang.Object
com.flowable.platform.service.permission.PermissionErrorMessageUtil
This utility helps creating template based permission (authorization) error messages.
- Author:
- Micha Kiener
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreatePermissionErrorMessage(String tenantId, String errorCode, String language, Map<String, Object> payload) Creates a permission error message based on the provided error code and payload.static StringCreates a permission error message based on the provided error code and payload.
-
Field Details
-
PERMISSION_ERROR_CODES_TEMPLATE_KEY
The template definition key used for permission (authorization) error messages.- See Also:
-
VARIANT_KEY_ERROR_CODE
- See Also:
-
VARIANT_KEY_LANGUAGE
- See Also:
-
-
Method Details
-
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
-