+ Start a Discussion
SS KarthickSS Karthick 

Soql for user Id

Hi folks,
       can anyone tell me soql for getting user id who has access the record??
Like 
I have created test objects
5 users in my org.
if user 1 creates record on test object then user2,user3,user5 access that reocrd and user4 cannot access the reocrd
I wanna soql query for get all user id who has permission to access the record that is created by user1

Thanks in advance
Karthick
Best Answer chosen by SS Karthick
bob_buzzardbob_buzzard
You can get at this information by querying the <sobject>Share sobject, although you may need to query public groups to see which users are members if the sharing is based on groups.

Each <sobject>Share record is the same format regardless of the actual sobject type - here's the docs for CaseShare:

https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_caseshare.htm

All Answers

bob_buzzardbob_buzzard
You can get at this information by querying the <sobject>Share sobject, although you may need to query public groups to see which users are members if the sharing is based on groups.

Each <sobject>Share record is the same format regardless of the actual sobject type - here's the docs for CaseShare:

https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_caseshare.htm
This was selected as the best answer
SS KarthickSS Karthick
Hy bob_buzzard,
Ans this ques:
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AgoFIAS

Thanks in advance
Karthick