Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PostFilter support for Optionals #10109

Closed
markbanierink opened this issue Jul 16, 2021 · 1 comment
Closed

Add PostFilter support for Optionals #10109

markbanierink opened this issue Jul 16, 2021 · 1 comment
Assignees
Labels
in: core An issue in spring-security-core status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement

Comments

@markbanierink
Copy link

Expected Behavior
Add functionality to use @PostFilter on Optional return types.

Current Behavior
Currently filtering is supported for collections, arrays, maps and streams. To add support for optional filtering, you have to create a custom handler extending the DefaultMethodSecurityExpressionHandler, add an implementation for optionals filtering (through stream filtering) and then register this new handler. This is very cumbersome.

@jzheaux
Copy link
Contributor

jzheaux commented Jul 19, 2021

This is related to an earlier discussion about @PostAuthorize.

In addition to Rob's recommendation (above) to use .orElse, @PostFilter is intended for filtering collections, so I'd be hesitant to support non-collection return types.

@jzheaux jzheaux closed this as completed Jul 19, 2021
@jzheaux jzheaux self-assigned this Jul 19, 2021
@jzheaux jzheaux added status: declined A suggestion or change that we don't feel we should currently apply in: core An issue in spring-security-core and removed status: waiting-for-triage An issue we've not yet triaged status: declined A suggestion or change that we don't feel we should currently apply labels Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core An issue in spring-security-core status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants