Skip to content

Commit 15b3744

Browse files
Fix setServletContext not being called for AuthorizationManagerWebInvocationPrivilegeEvaluator
Issue gh-10908
1 parent 20b94c4 commit 15b3744

File tree

1 file changed

+4
-1
lines changed
  • config/src/main/java/org/springframework/security/config/annotation/web/builders

1 file changed

+4
-1
lines changed

config/src/main/java/org/springframework/security/config/annotation/web/builders/WebSecurity.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,10 @@ private RequestMatcherEntry<List<WebInvocationPrivilegeEvaluator>> getRequestMat
344344
if (filter instanceof AuthorizationFilter) {
345345
AuthorizationManager<HttpServletRequest> authorizationManager = ((AuthorizationFilter) filter)
346346
.getAuthorizationManager();
347-
privilegeEvaluators.add(new AuthorizationManagerWebInvocationPrivilegeEvaluator(authorizationManager));
347+
AuthorizationManagerWebInvocationPrivilegeEvaluator evaluator = new AuthorizationManagerWebInvocationPrivilegeEvaluator(
348+
authorizationManager);
349+
evaluator.setServletContext(this.servletContext);
350+
privilegeEvaluators.add(evaluator);
348351
}
349352
}
350353
return new RequestMatcherEntry<>(securityFilterChain::matches, privilegeEvaluators);

0 commit comments

Comments
 (0)