Skip to content

Commit

Permalink
Move sitemesh registration location
Browse files Browse the repository at this point in the history
  • Loading branch information
codeconsole committed Oct 9, 2024
1 parent f768c26 commit 0959844
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -670,12 +670,6 @@ to default to 'Annotation'; setting value to 'Annotation'
}
log.trace 'Using SecurityContextHolder strategy {}', SCH.strategyName

// if sitemesh 3 is installed, an additional sitemesh 3 filter will need to be registered
// as part of the security filter chain so that pages are decorated using the security context
if (applicationContext.getBean('sitemesh3Secured')) {
SpringSecurityUtils.clientRegisterFilter('sitemesh3Secured', SecurityFilterPosition.FORM_CONTENT_FILTER.previous())
}

// build filters here to give dependent plugins a chance to register some
SortedMap<Integer, String> filterNames = ReflectionUtils.findFilterChainNames(conf)
def securityFilterChains = applicationContext.securityFilterChains
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,13 @@ final class SpringSecurityUtils {
allConfiguredFilters[name] = filter
SpringSecurityUtils.configuredOrderedFilters[order] = filter
}
// if sitemesh 3 is installed, an additional sitemesh 3 filter will need to be registered
// as part of the security filter chain so that pages are decorated using the security context
FilterRegistrationBean sitemesh3Filter = (FilterRegistrationBean) applicationContext.getBean('sitemesh3Secured')
if (sitemesh3Filter) {
allConfiguredFilters['sitemesh3Secured'] = sitemesh3Filter.filter
SpringSecurityUtils.configuredOrderedFilters[SecurityFilterPosition.FORM_CONTENT_FILTER.previous().order] = sitemesh3Filter.filter
}
log.trace 'Ordered filters: {}', SpringSecurityUtils.configuredOrderedFilters

if (chainMap) {
Expand Down

0 comments on commit 0959844

Please sign in to comment.