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
AbAb 

Apex query for access rights on profiles

Hello,

Is it possible to get by querying in query editor the Objects and the profiles and the access they have ?

 
Best Answer chosen by Ab
Kushal MishraKushal Mishra
Hi Sandrine,

Please try below query, i hope you will do some changes accordingly and get your answer .


SELECT Id, SObjectType, PermissionsRead, PermissionsCreate
FROM ObjectPermissions
WHERE parentid in (select id from permissionset where
PermissionSet.Profile.Name = 'System Administrator')

All Answers

Kushal MishraKushal Mishra
Hi Sandrine,

Please try below query, i hope you will do some changes accordingly and get your answer .


SELECT Id, SObjectType, PermissionsRead, PermissionsCreate
FROM ObjectPermissions
WHERE parentid in (select id from permissionset where
PermissionSet.Profile.Name = 'System Administrator')
This was selected as the best answer
sandeep@Salesforcesandeep@Salesforce
Hi Sandrine,

Yes.  Please follow below link 
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_objectpermissions.htm