在一个过滤器中,如何匹配同一个 Controller 的多个 Action ?
def filters = {
organisationDelete(controller: "organisation", action: "confirmDelete, delete") {
//...
}
}
在此映射中,我将“confirmDelete”作为 GET,将“delete”作为 POST
最佳答案
在旧的 ACEGI 插件中,我可以编写以逗号分隔的操作。不过,现在有了 Spring Security Core,我必须使用管道。所以,下面解决了这个问题
action: "confirmDelete|delete"
关于Grails 过滤多个操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7572108/