【发布时间】:2019-03-17 15:17:24
【问题描述】:
我试图在 spel 表达式中访问 spring 应用程序属性的值,但对我来说似乎是不可能的。我试图在 oauth2 范围之前放置一个前缀,因此当 PreAuthorize 发生时,完整的范围名称将是前缀+“某物”,因此它可以在将来动态更改:
@PreAuthorize("#oauth2.hasScope(${prefixes.someprefix}+'/stock.r')")
spel 文档中的每个示例似乎都是 hello world 类型,而其他示例仅在 @Value 注释中使用属性访问。
【问题讨论】:
标签: spring properties oauth-2.0 spring-el