自定义每个模式拒绝访问

时间:2017-08-25 13:07:24

标签: grails spring-security grails-2.0 grails-controller

我使用Grails 3.1.X和Spring.Core.Security 3.1 我在application.groovy文件中有这个配置:

grails.plugin.springsecurity.securityConfigType = "Annotation"
grails.plugin.springsecurity.password.algorithm = 'bcrypt'
grails.plugin.springsecurity.active = true
grails.plugin.springsecurity.logout.postOnly = false
grails.plugin.springsecurity.failureHandler.exceptionMappings = [

        [exception: AccountExpiredException.name, url: '/expiredAccount']
]

grails.plugin.springsecurity.controllerAnnotations.staticRules = [

        [pattern: '/', access: ['permitAll']],
        .....
        [pattern: '/test/**', access: ['ROLE_ADMIN']],

当我登录并尝试到达/测试过滤器阻止我,这很好,并告诉我,我没有权限。 我想将其重定向到特定的控制器/操作或gsp以显示自定义页面。有可能吗?

0 个答案:

没有答案