| .. | .. |
|---|
| 52 | 52 | com.google.inject.Provider<EntityManager> emProvider; |
|---|
| 53 | 53 | |
|---|
| 54 | 54 | public void filter(ContainerRequestContext containerRequestContext) throws IOException { |
|---|
| 55 | | - // log.info("scw {}, {}", scw, scw.getClass()); |
|---|
| 56 | | - log.info("MACHED res: {}", containerRequestContext.getUriInfo().getMatchedResources()); |
|---|
| 57 | | - // dispatcher.getDefaultContextObjects().remove(SecurityContextWrapper.class); |
|---|
| 58 | 55 | ResourceMethodInvoker methodInvoker = (ResourceMethodInvoker) containerRequestContext.getProperty("org.jboss.resteasy.core.ResourceMethodInvoker"); |
|---|
| 59 | 56 | Method method = methodInvoker.getMethod(); |
|---|
| 60 | 57 | |
|---|
| .. | .. |
|---|
| 82 | 79 | scw.setOrganizationsIds(orgs); |
|---|
| 83 | 80 | containerRequestContext.setSecurityContext(scw); |
|---|
| 84 | 81 | // Next line provide injection in resource methods |
|---|
| 85 | | - log.info("TEST context {}", ResteasyProviderFactory.getContextData(BasicSecurityContext.class)); |
|---|
| 86 | 82 | ResteasyProviderFactory.pushContext(BasicSecurityContext.class, scw); |
|---|
| 87 | | - // log.info("{}", dispatcher.getDefaultContextObjects()); |
|---|
| 88 | | - // dispatcher.getDefaultContextObjects().put(SecurityContextWrapper.class, secContext); |
|---|
| 89 | | - log.info("Added custom SecurityContext for user {}", username); |
|---|
| 83 | + log.debug("Added custom SecurityContext for user {}, orgs: {}", username, orgs); |
|---|
| 90 | 84 | } |
|---|
| 91 | 85 | } |
|---|
| 92 | 86 | |
|---|