Save Entity over WCF with Authorizer

Posts   
 
    
ianvink
User
Posts: 394
Joined: 15-Dec-2006
# Posted on: 10-Oct-2008 17:16:41   

Is it possible to get the Authorizer that my customer entity has to be sent over the wire to the WCF service that saves the "customer"

When the WCF server gets the "customer" entity, the AuthorizerToUse is null.

Ian

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 11-Oct-2008 08:06:21   

Hi Ian.

The AuthotizerToUse will be available only if that was set before. For example, if you sent it to the client with the AuthorizerToUse set, do some modifications and then set it back to the service.

How are you setting the AuthorizerToUse (Through the porperty in OnInitializing method, on the CreateAuditor override, using DependencyInjection) ?

David Elizondo | LLBLGen Support Team
ianvink
User
Posts: 394
Joined: 15-Dec-2006
# Posted on: 14-Oct-2008 20:45:53   

I am using DependencyInjection in a WCF service, liek this:


  <configSections>
    <section name="sqlServerCatalogNameOverwrites" type="System.Configuration.NameValueSectionHandler" />
    <section name="dependencyInjectionInformation" type="SD.LLBLGen.Pro.ORMSupportClasses.DependencyInjectionSectionHandler, SD.LLBLGen.Pro.ORMSupportClasses.NET20, Version=2.6.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27"/>
  </configSections>

  <dependencyInjectionInformation>
    <additionalAssemblies>
      <assembly filename="ERMS.POC.AuditorBermuda.dll"/>
      <assembly filename="ERMS.POC.AuthorizerBermuda.dll"/>
    </additionalAssemblies>
  </dependencyInjectionInformation>

And the code that gets the customers is this. But no authorizer is attached after the entities are created.


EntityCollection<CustomerEntity> entities = null;
var items = (from p in linq.Customer
                             orderby p.ContactName
                             select p);

entities = ((ILLBLGenProQuery)items).Execute<EntityCollection<CustomerEntity>>();

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 14-Oct-2008 21:48:45   

Hi

Is the authorizer dll in the application bin folder ? If not, you can specify the assembly full path in the filename attribute Could you also try specifing the authorizer dll's full name as in the second assembly line in the example below ?


<dependencyInjectionInformation>
    <additionalAssemblies>
        <assembly filename="MyAuthorizers.dll"/>
        <assembly fullName="SD.Examples.Injectables, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
    </additionalAssemblies>
    <instanceTypeFilters>
        <instanceTypeFilter namespace="Northwind"/>
    </instanceTypeFilters>
</dependencyInjectionInformation>