enter image description here

enter image description here

I meant to say how to find using SOQL, APEX or REST API.

Is there a way to find sharing model for the standard objects using SOQL/REST/SOAP? like what are the sharing settings for opportunity or account object? etc..

  • I am pretty sure you know how to reach Setup - Security Controls - Sharing Setting ..... are you trying to refer something else?
    – Ayub
    May 25, 2018 at 14:52
  • updated my question.
    – Nick
    May 25, 2018 at 14:54
  • Hey @NickKahn, did you find a solution for this? Oct 10, 2019 at 19:06
  • 1
    @RogerioHonorio nope I did not, but I heard you can do using metadata api but I haven't tried
    – Nick
    Oct 10, 2019 at 19:08
  • Thank you, it seems like we can as you said using Metadata Api. developer.salesforce.com/docs/atlas.en-us.api_meta.meta/… Oct 10, 2019 at 19:10

3 Answers 3


All sharing Settings should be in the same place Setup - Security Controls - Sharing Setting in classic, Setup - Security - Sharing Setting in Lightning or just searching for Sharing Setting in the setup quick find.

  • Updated my question.
    – Nick
    May 25, 2018 at 14:54

For the Standard object, you can use Organization object to achieve this, query like

Organization org = [Select Id, DefaultAccountAccess, DefaultContactAccess, DefaultLeadAccess, DefaultOpportunityAccess from Organization];


Verified that it does return values but with different verbiage:

Private ==> none;

Public Read/Write ==> Edit;

Public Read Only ==> Read;

Controlled by Parent ==> ControlledByParent;


  • i don't think that organization pulls from the OWD sharing model, for an example, my Opportunity is public read only and when I run the above query it gets me edit for the opportunity, does not seems correct. any thoughts?
    – Nick
    May 25, 2018 at 15:12
  • It does return correct value - but with different verbiage..Private = none; Public Read/Write = Edit; Public Read Only = Read...etc
    – Ayub
    May 25, 2018 at 18:30
  • I have updated my question and add the screen shot, please have a look.
    – Nick
    May 26, 2018 at 20:21

First connect SFDX to salesforce org

Loop on each object (custom or standard) run: sfdx force:source:retrieve -m CustomObject:Your_Custom_Object__c

The Meta xml file retrieved will contain visibility & sharing model tags (pub/priv/rw) e.g. Private Public

You can parse for this and get it for the org and all objs

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .