Anonymous access in BDC

When anonymous users log into the SharePoint site which has BDC web parts, you will see the error message “You do not have permission to access abc in xyzInstance”. This is fixed in the Infrastructure update of WSS and MOSS. In the Application Definition File, for each method instance ( for which we need to give anonymous access), we need to add a property called AllowAnonymousExecute. Its a boolean value which needs to be set as true.

<MethodInstance Type="Finder" ReturnParameterName="Products" ReturnTypeDescriptorName="ProductDataReader" ReturnTypeDescriptorLevel="0" Name="ProductFinderInstance">

    <Properties>

         <Property Name="AllowAnonymousExecute" Type="System.Boolean">true</Property>

    </Properties>

</MethodInstance>

Remember, this is effective only on MethodInstances. Internally Association is a special MethodInstance and so it should work when AllowAnonymousExecute property is used within it as well. This essentially means that it works for all the BDC web parts including Business Related Web Part.

 

<Associations>

<Association Name="FK_DimProduct_DimProductSubcategory_Instance" AssociationMethodEntityName="DimProduct" AssociationMethodName="FK_DimProduct_DimProductSubcategory" AssociationMethodReturnParameterName="@DimProduct" AssociationMethodReturnTypeDescriptorName="Reader" AssociationMethodReturnTypeDescriptorLevel="0" IsCached="true">

<Properties>

<Property Name="AllowAnonymousExecute" Type="System.Boolean">true</Property>

</Properties>

<SourceEntity Name="DimProductSubcategory" />

<DestinationEntity Name="DimProduct" />

</Association>

</Associations>