>
> You can inject the client identity in the current call context:
>
> client:
>
> // this is you sink's process message:
> ProcessMessage(IMessage msg, ....)
> {
>       MethodCall mc = msg as MethodCall;
>       if (mc != null) {
>               mc.LogicalCallContext.SetData ("UserName",  
> WindowsIdentity.GetCurrent
> ().Name);
>       }
>
> }
>
> server:
>
> class SomeRemoteClass : MarshalByRefObject
> {
>       public void Method ()
>       {
>                       Console.WriteLine (CallContext.GetData("UserName"));
>       }
> }
>
>
> There might be another ways to do this, though. I'm just writing this
> down from weak memory ;-)
>
> Robert

Thanks!

I played a bit and this does the trick as well
ProcessMessage()
{
        Thread.CurrentPrincipal = .....
        _next.ProcessMessage()
}

and then

public class SomeObject : MarshalByRefObject
{
        void Method()
        {
                IPrincipal = Thread.CurrentPrincipal
        }
}

Though I'm not sure which one is better. I fear that my way may  
interfere with some CAS stuff in .NET itself, although after  
processing message I assign to Thread.CurrentPrincipal the original  
value.

P.S Sorry for the mail on priv :)

Best regards,
Maciej Paszta
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to