Print Page | Close Window

Interceptors for RPC methods?

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3597
Printed Date: 13-Apr-2026 at 7:15pm


Topic: Interceptors for RPC methods?
Posted By: stephenmcd1
Subject: Interceptors for RPC methods?
Date Posted: 28-Aug-2012 at 3:32pm
We use a custom EntityServerQueryInterceptor and a custom EntityServerSaveInterceptor in our application to do some custom authorization logic but I don't see a way to do similar logic for RPC calls (called via InvokeServerMethodAsync).  I don't really want to have to remember to put logic in every one of our RPC calls.  The way the save/query interceptors work is great for queries and saves and lets us have all that cross-cutting logic in one place....but without being able to have that logic apply to RPC calls leaves a bit of a hole in our logic.



Replies:
Posted By: sbelini
Date Posted: 29-Aug-2012 at 1:56pm
Hi Stephen,
 
Unfortunatelly, DevForce does not currently offer this functionality and the alternative would have to have this logic on every RPC call.
Another possibility, would be a method common to all RPCs that would evaluate authorization. You would still have to manually call this method and handle its results on each RPC.
 
Regards,
   Silvio.


Posted By: stephenmcd1
Date Posted: 29-Aug-2012 at 3:36pm

So you don't "currently offer this functionality" - but do you on making an enhancement to support this kind of thing?

Obviously it's not terribly difficult to make the change in all my RPC methods but I'm just worried that in 6 months we might totally forget to do that on new RPC methods.

Thanks



Posted By: sbelini
Date Posted: 30-Aug-2012 at 11:55am
Stephen,
 
I'll add this to our feature request list.
However, I must advise that this feature is not a high priority and, most likely, will not be present in the next couple releases.
 
Silvio.


Posted By: asuvorov
Date Posted: 12-Sep-2012 at 11:33am
I second the request. That would be really useful functionality.

stephenmcd1, look at PostSharp MethodInterceptionAspect attribute. This may solve your problem.



Print Page | Close Window