override method of Grails plugin bean

后端 未结 1 334
攒了一身酷
攒了一身酷 2021-01-06 11:57

The Spring Security plugin provides a bean named \'springSecurityService\' of type grails.plugins.springsecurity.SpringSecurityService. I need to override the <

相关标签:
1条回答
  • 2021-01-06 12:32

    Go back to subclassing and redefining the bean in resources.groovy, but satisfy the dependencies. They're auto-injected by name but all listed, so add them explicitly to your redefinition:

    springSecurityService(CustomSpringSecurityService) {
       authenticationTrustResolver = ref('authenticationTrustResolver')
       grailsApplication = ref('grailsApplication')
       passwordEncoder = ref('passwordEncoder')
       objectDefinitionSource = ref('objectDefinitionSource')
       userDetailsService = ref('userDetailsService')
       userCache = ref('userCache')
    }
    
    0 讨论(0)
提交回复
热议问题