Improve AuthorizationManager configuration error messages

Closes gh-16193
This commit is contained in:
Dmitry Spikhalsky 2024-11-30 16:29:31 -05:00 committed by Josh Cummings
parent 39cd8d9faf
commit 32e1d4c990
1 changed files with 2 additions and 2 deletions

View File

@ -76,12 +76,12 @@ class AuthorizationFilterParser implements BeanDefinitionParser {
public BeanDefinition parse(Element element, ParserContext parserContext) {
if (!isUseExpressions(element)) {
parserContext.getReaderContext()
.error("AuthorizationManager must be used with `use-expressions=\"true\"", element);
.error("AuthorizationManager must be used with `use-expressions=\"true\"; Add `use-authorization-manager=\"false\"` or enable use of expressions in `<http>` block", element);
return null;
}
if (StringUtils.hasText(element.getAttribute(ATT_ACCESS_DECISION_MANAGER_REF))) {
parserContext.getReaderContext()
.error("AuthorizationManager cannot be used in conjunction with `access-decision-manager-ref`",
.error("AuthorizationManager cannot be used in conjunction with `access-decision-manager-ref`; either remove the reference to AccessDecisionManager or add `use-authorization-manager=\"false\"` to `<http>` block",
element);
return null;
}