【发布时间】:2018-11-03 02:43:52
【问题描述】:
我正在使用 Spring Security ACL。但我有一个要求,即所有人都可以访问一个特定对象,而无需检查 hasPermission 或 hasRole。
我不确定如何实现这一点,我尝试了以下方法:
@NotNull
@PostAuthorize("hasPermission(returnObject, 'read') or #aLong==1")
@Override
Optional<DBO_TYPE> findById(@NotNull Long aLong);
并且还使用了 returnObject
@NotNull
@PostAuthorize("hasPermission(returnObject, 'read') or returnObject.id==1")
@Override
Optional<DBO_TYPE> findById(@NotNull Long aLong);
感谢任何有关如何实现此功能的建议。
【问题讨论】:
标签: java spring-boot spring-security acl