DataPortal_Create and CommandBase Object

DataPortal_Create and CommandBase Object

Old forum URL: forums.lhotka.net/forums/t/10870.aspx


xenoputtss posted on Monday, November 14, 2011

We have run into a strange issue that (of course) I don't understand.

First some basic info

we are using CSLA 3.8, WCF, and Impersonation (Lets call this App1). We also have another app that is WinForms (using windows auth), and using a WCF Dataportal (this App2).

 

we have this code

protected override void DataPortal_Create(){

   CreateId = BusinessLayer.Command.GetUnityUserIdCommand.GetCurrentlyLoggedInUnityUserId();

}

Now when App2 runs, this all works correctly and a call is made to our DB with the right account.

But when App1 runs, this will fail because the account that it uses is the account of the IIS Worker Process.
Now, If I were to move that line into the DataPortal_Insert(), it will work.  It seems as though when using the DataPortal_Create and a CommandBase Object that CSLA forgets to impersonate the user.
What am i doing wrong?  Aside from this issue everything else is working great.

 

Copyright (c) Marimer LLC