Last active
May 1, 2019 17:20
-
-
Save sfdcale/e7311e7f31d9f0684674c5bad2cfc978 to your computer and use it in GitHub Desktop.
Object Permissions by Profile and Permission Sets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Run the below query to see what access Profiles('System Administrator','Standard User') are giving to objects('Lead','Account') | |
| SELECT sobjecttype, | |
| Parent.Profile.Name, | |
| permissionscreate, | |
| permissionsdelete, | |
| permissionsviewallrecords, | |
| permissionsmodifyallrecords, | |
| permissionsread, | |
| permissionsedit | |
| FROM objectpermissions | |
| WHERE sobjecttype IN ( 'Lead', 'Account','LicensePolicy__c','abc__c','NLS_Billing_Item__c' ) | |
| AND parentid IN (SELECT id | |
| FROM permissionset | |
| WHERE isownedbyprofile = true | |
| AND profile.NAME IN ( 'System Administrator', | |
| 'Standard User' )) | |
| //Run the below query to see what access PermissionSets('PS_One','PS_Two') are giving to objects('Lead','Account') | |
| SELECT parent.label, | |
| sobjecttype, | |
| permissionscreate, | |
| permissionsdelete, | |
| permissionsviewallrecords, | |
| permissionsmodifyallrecords, | |
| permissionsread, | |
| permissionsedit | |
| FROM objectpermissions | |
| WHERE sobjecttype IN ( 'Lead', 'Account' ) | |
| AND parentid IN (SELECT id | |
| FROM permissionset | |
| WHERE isownedbyprofile = false | |
| AND label IN ( 'PS_One', 'PS_Two' )) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment