I want to allow my users to only edit records they own with two objects which are in a Master/Detail setup.

I have the following setup :

Master Object : OWD : Public Read Only User's Permission Set for Object : Read, Create, Edit

Detail Object : OWD : Controlled by Parent User's Permission Set for Object : Read, Create, Edit

This is working fine until I use a VF page I have made as the Edit Override in the Detail object. Users can only edit records they own.

I am using a VF page as the Edit override on the Detail object. I am not overriding the View for the object. When I use the VF page users can edit any of the detail records, including ones they don't own - and even ones which are locked !

The VF page is nothing special. Here it is :

        <!-- **********   [Record Type : Master ]   **********  -->
        <apex:outputpanel >
            <apex:pageblocksection title="Information" showheader="true" columns="2">
                <apex:outputfield value="{!Review__c.Name}"/>
                <apex:inputfield value="{!Vendor_Product_Review__c.Department__c}" required="false"/>
                <apex:outputfield value="{!Review__c.Product__c}"/>
                <apex:pageblocksectionitem />
                <apex:inputfield value="{!Review__c.Reviewed_Product__c}" required="false"/>
                <apex:pageblocksectionitem />
                <apex:outputfield value="{!Review__c.Product2__c}" />
                <apex:pageblocksectionitem />

And that's essentially it. Nothing special.

The VF page is included in the Permission Set, so it's nothing weird about that.

I'm at a total loss. Anybody have any ideas ?

  • 1
    Do you use an Apex extensions? Do you specify with sharing? – Adrian Larson Sep 1 '16 at 20:27
  • No extensions - just standard controller for the custom object. – Zoom_v Sep 1 '16 at 20:28
  • The VF page is essentially just a bunch of inputfields and pageblocksections. – Zoom_v Sep 1 '16 at 20:31
  • 1
    If you look at the M/D field setup, is Sharing Setting set to Read Only: Allows users with at least Read access to the Master record to create, edit, or delete related Detail records.? – Adrian Larson Sep 1 '16 at 23:22
  • I updated my original post to include the VF page code. The OWD for the Master is Public Read Only ; the Detail is Controlled By Parent. There is no other Sharing going on with either objects. Like I said, it all works fine whenever I don't use the VF page. Once I start using the VF page for the edit override in the Detail object everybody is able to edit any of the detail records, including the ones which are Locked. – Zoom_v Sep 2 '16 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.