function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DannyCDannyC 

Access to Standard Object Permissions

In the Profile page there is a "Standard Object Permissions" section.  This section enables the option of having "View All" or "Modify All" permission to a class of objects (eg: Accounts, or Opportunities).  How can I programmatically read whether these values are set?  In which database tables are these configuration options stored?

 

Danny.

aalbertaalbert

Check the Profile object. For example, there are fields "PermissionsModifyAllData" and "PermissionsViewAllData" on the Profile object. Tools like the Schema Explorer in the force.com ide or Apex Explorer are great tools to view and query your specific salesforce.com schema. 

 

 

aalbertaalbert
I just re-read your post and I think you are referring to the new functionality to grant those two permissions (Modify All or View All data) to a specific object. I am not aware of those settings being exposed in the API.
aztockaztock

The only access programatically is via metadata: use object DescribeResult.IsAccessible() and IsCreatable().

However this is only works for the "logged in" user... Would not work for if you are trying to get this information for another user in the system.

 

Schema.DescribeSobjectResult  objDs = Schema.getGlobalDescribe().get('Account').getDescribe();

objDs.IsAccessible();

objDs.IsCreatable();