Open
Description
Describe the bug
Using Authorizing Arbitrary Objects of Spring Security in combination with a Pageable Spring Data result fails.
To Reproduce
- Add "@PreAuthorize" to an Entity class.
- Add "@AuthorizeReturnObject" to a repository class method with return type Page.
- Call the repo method.
java.lang.ClassCastException: class org.springframework.security.authorization.method.AuthorizationAdvisorProxyFactory$ContainerTypeVisitor$$Lambda/0x0000791458a2cb00 cannot be cast to class org.springframework.data.domain.Page (org.springframework.security.authorization.method.AuthorizationAdvisorProxyFactory$ContainerTypeVisitor$$Lambda/0x0000791458a2cb00 and org.springframework.data.domain.Page are in unnamed module of loader 'app')
Expected behavior
A paged result of security proxied objects should be returned from the repository method.