-
1. Re: Interceptor before s:hasPermission?
mwohlf Jan 6, 2010 11:25 PM (in response to sdnakhla)Hi Steve,
did you check Tobia's Interceptor in
this thread as far as I understand it wraps all of Seam's Interceptors. -
2. Re: Interceptor before s:hasPermission?
sdnakhla Jan 8, 2010 7:51 PM (in response to sdnakhla)I used that as the basis for my interceptor. However, the permission check still seems to be occurring before my interceptor is called. Here is how I have it setup:
I have a method that I wish to protect, but need to inject an object into the working memory before the permission check occurs. My method looks like this:
@MyAnnotation public class MyClass { @Restrict("{s:hasPermission('blah', 'blah')}") public void myMethod(){ ... } }
I would expect my interceptor to be called before s:hasPermission goes through. However, I get an AuthorizationException every time, and logging statements in my interceptor are never being displayed, leading me to believe that the permission check is failing before my interceptor.
Any thoughts as to how I can get around this issue?
-
3. Re: Interceptor before s:hasPermission?
mwohlf Jan 8, 2010 10:37 PM (in response to sdnakhla)make sure you use InterceptorType.CLIENT and the SecurityInterceptor.class in the arround set:
@Interceptor( stateless=true, type=InterceptorType.CLIENT, around = { BijectionInterceptor.class, MethodContextInterceptor.class, ConversationInterceptor.class, SynchronizationInterceptor.class, ConversationalInterceptor.class, RemoveInterceptor.class, SeamInterceptor.class, SecurityInterceptor.class, TransactionInterceptor.class, EventInterceptor.class, HibernateSessionProxyInterceptor.class, ManagedEntityInterceptor.class })
-
4. Re: Interceptor before s:hasPermission?
sdnakhla Jan 9, 2010 3:52 AM (in response to sdnakhla)Ahhh much better. The interceptor type was what was missing. Thanks for your help.