【发布时间】:2015-12-19 03:09:12
【问题描述】:
我正在关注本教程https://grails-plugins.github.io/grails-spring-security-core/guide/tutorials.html,但@Secured注解无法解析,尽管我应用了Spring Security插件并编译。
import grails.plugin.springsecurity.annotation.Secured
class SecureController {
@Secured('ROLE_ADMIN')
def index() {
render 'Secure access only'
}
}
【问题讨论】:
-
你的构建文件是什么样的? (3.x 的 build.gradle 或 buildconfig.groovy)
-
build.gradle 依赖项 { ... compile 'org.grails.plugins:spring-security-core:3.0.0.M1' compile "org.springframework.security:spring-security-core:4.0. 1.RELEASE”编译“org.springframework.security:spring-security-web:4.0.2.RELEASE”…}