Closed vsaar closed 11 years ago
Very nice! I had the same problem, solved it with a metaclass workaround: overriding the method getWebXmlFilterOrder()
in <application>/scripts/_Events.groovy
:
eventWebXmlStart = { String tmpfile ->
/** Change the order of filters: multitenant must run before springsecuritycore (position 1100)
* See grails.plugin.webxml.FilterManager and plugins/webxml-1.4.1/scripts/_Events.groovy */
def multitenantPlugin = pluginManager.getGrailsPlugin("multi-tenant-single-db")
multitenantPlugin.instance.metaClass.getWebXmlFilterOrder = { [tenantFilter: 1050] }
}
@sronderos, I just realized today that you asked for documentation of this feature in the merge commit. I also saw that you already took care of if, so thanks for that.
I guess it would be better to post that on Github as a comment instead of in the commit message. Or use the @username syntax as supported by Github, which will send a notification.
Using the changes from this pull request, the tenant filter's position is affected by the
multiTenant.resolveTenantBeforeLogin
config property. Setting it totrue
results in the filter being registered before Spring Security's form login filter.