1
0
mirror of synced 2026-08-05 17:57:15 +00:00

Add AfterMethodAuthorizationManager

- Removes the need to keep MethodAuthorizationContext#returnObject
in sync with other method parameters
- Restores MethodAuthorizationContext's immutability

Closes gh-9591
This commit is contained in:
Josh Cummings
2021-04-08 11:36:03 -06:00
parent 2b494ebc5f
commit 6828987b4b
12 changed files with 176 additions and 74 deletions
@@ -141,7 +141,7 @@ final class MethodSecurityConfiguration implements ImportAware, InitializingBean
if (jsr250Enabled()) {
beforeAdvices.add(getJsr250AuthorizationMethodBeforeAdvice());
}
return new DelegatingAuthorizationMethodBeforeAdvice(beforeAdvices);
return new DelegatingAuthorizationMethodBeforeAdvice<>(beforeAdvices);
}
private PreFilterAuthorizationMethodBeforeAdvice getPreFilterAuthorizationMethodBeforeAdvice() {
@@ -192,7 +192,7 @@ final class MethodSecurityConfiguration implements ImportAware, InitializingBean
List<AuthorizationMethodAfterAdvice<MethodAuthorizationContext>> afterAdvices = new ArrayList<>();
afterAdvices.add(getPostFilterAuthorizationMethodAfterAdvice());
afterAdvices.add(getPostAuthorizeAuthorizationMethodAfterAdvice());
return new DelegatingAuthorizationMethodAfterAdvice(afterAdvices);
return new DelegatingAuthorizationMethodAfterAdvice<>(afterAdvices);
}
private PostFilterAuthorizationMethodAfterAdvice getPostFilterAuthorizationMethodAfterAdvice() {