How to authenticate against a collection of domain objects in Spring Expression Language SpEL

不打扰是莪最后的温柔 提交于 2019-12-07 05:34:25

I am not sure that it is possible to do in plain SpEL. But you can try a workaround:

@PreAuthorize("principal.hasTransactionId(#dto.transactionId)")

Then you need to add hasTransactionId(Integer transactionId) method to your principal. This method must return a boolean value.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!