07-07-2010 12:28 AM
I would like to add FLS for my custom entity.
When users update and view,it is working correctly. If a field is ReadOnly access for a user, it is readonly in detail mode.
But when adding new entity, it is not working, it is not applying FLS.
I have changed the settings in web.config like this:
<add key="ApplyFieldLevelSecurityOnInsert" value="true">
and re-deploy the website.
But users can still insert on fields that are read-only or no-acess right when adding new entity.
Is there any solution?
07-15-2010 03:19 PM
Field level security will return read-write access for all properties on a new entity until the Owner property has been set. This makes sense since field level security is driven from the Owner property. It is likely that the Owner property is not yet set at the time you are setting other properties.
You might try to set the Owner property in the OnCreate event of your entity. In fact, this is what is done on the Account, Contact, and Opportunity entities.