Skip to content

Commit

Permalink
Merge branch '6.1.x' into 7.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
codeconsole committed Oct 8, 2024
2 parents 0314580 + 523bd56 commit 202c59a
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import groovy.transform.CompileDynamic
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import org.apache.commons.lang.StringEscapeUtils
import org.springframework.boot.web.servlet.FilterRegistrationBean
import org.springframework.context.ApplicationContext
import org.springframework.security.access.hierarchicalroles.RoleHierarchy
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken
Expand Down Expand Up @@ -420,11 +421,14 @@ final class SpringSecurityUtils {
assert !oldFilter,
"Cannot register filter '$beanName' at position $order; '$oldFilter' is already registered in that position"

Filter filter = getBean(beanName)
configuredOrderedFilters[order] = filter
def filter = getBean(beanName)
if (filter instanceof FilterRegistrationBean) {
filter = ((FilterRegistrationBean) filter).filter
}
configuredOrderedFilters[order] = (Filter) filter

List<GrailsSecurityFilterChain> filterChains = getBean('securityFilterChains', List)
mergeFilterChains configuredOrderedFilters, filter, beanName, order, filterChains
mergeFilterChains configuredOrderedFilters, (Filter) filter, beanName, order, filterChains

log.trace 'Client registered bean "{}" as a filter at order {}', beanName, order
log.trace 'Updated filter chain: {}', filterChains
Expand Down

0 comments on commit 202c59a

Please sign in to comment.