+ Start a Discussion
Big EarsBig Ears 

Query for all users with access to a particular record

Hey all,

Is there a way to reliably return a list of all Users with a particular level of access to a particular record?
  • UserRecordAccess looked useful, but the use case seems to be about returning a number of records that pertain to a single user's access
  • CustomObject__Share could work, but then this can contain groups (which can be nested) so that can result in multiple queries

Is there a recommended approach?

With thanks, Andy.

Hi Andy, 
List<id> listofIds = new List<id>();
for(Accountshare acs : [select id,UserOrGroupId  from AccountShare Accountid = 'YOUR_ACCOUNT_ID'])

Questing AccountShare we can fetch list of mix (user and groups ) and then please follow below response 

Sandeep Singhal