-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore thread-local auth cache so that it still applies some caching…
… (old style) when caching is disabled.
- Loading branch information
1 parent
5d62dee
commit ab80743
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/main/java/org/ohdsi/webapi/shiro/filters/CacheFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.ohdsi.webapi.shiro.filters; | ||
|
||
import org.ohdsi.webapi.security.PermissionService; | ||
import org.ohdsi.webapi.shiro.PermissionManager; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
|
||
import javax.servlet.Filter; | ||
import javax.servlet.FilterChain; | ||
import javax.servlet.FilterConfig; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.ServletRequest; | ||
import javax.servlet.ServletResponse; | ||
import java.io.IOException; | ||
|
||
@Component | ||
public class CacheFilter implements Filter { | ||
|
||
@Autowired | ||
private PermissionManager permissionManager; | ||
|
||
@Override | ||
public void init(FilterConfig filterConfig) throws ServletException { | ||
|
||
} | ||
|
||
@Override | ||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { | ||
|
||
permissionManager.clearAuthorizationInfoCache(); | ||
chain.doFilter(request, response); | ||
} | ||
|
||
@Override | ||
public void destroy() { | ||
|
||
} | ||
} |