Here is the code, if someone is interested in it :)

def return_noperm_function():
  return {"state": "noperm"}

def check_login(ctx):
  if not function_for_checking_login_and_password():
    ctx.descriptor.function = return_noperm_function
    ctx.in_object = ()

tests.event_manager.add_listener("method_call", check_login)


Don't forget to somehow bypass other events when returning 'noperm' (for 
example 'method_return_object').

azur


______________________________________________________________
> Od: "Burak Arslan" <[email protected]>
> Komu: azurIt <[email protected]>
> Dátum: 30.09.2011 17:52
> Predmet: Re: [Soap-Python] Stop method processing via method_call event
>
> CC: [email protected]
>On 30.09.2011 18:37, azurIt wrote:
>> Because it will return soap fault, i need to return correct soap response.
>>
>>
>
>I'd argue strongly that an authentication error is a legitimate use-case 
>for a fault. But then it's not my really place to say that.
>
>Anyway, you can set ctx.descriptor.function in the event to whatever you 
>want. normally it's set to the function decorated by @rpc.
>
>also set the ctx.in_object to the argument array to the function. look 
>at ServiceBase.call_wrapper source.
>
>burak
>
>
>
_______________________________________________
Soap mailing list
[email protected]
http://mail.python.org/mailman/listinfo/soap

Reply via email to