在我的普惠制中我有以下几点..。
<sec:loggedInUserInfo field="givenName"/>我如何在Grails过滤器中做同样的事情呢?
发布于 2014-04-11 16:20:42
我很肯定你可以把弹簧安全服务注入你的过滤器。例如:
package com.example
class MyFilters {
def springSecurityService
def filters = {
all(controller:'*', action:'*') {
before = {
println springSecurityService.principal.givenName
}
}
}
}https://stackoverflow.com/questions/23017722
复制相似问题