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
Lasith SameeraLasith Sameera 

Retrieving shared object read permissions

Hi,

I want to get information about the users and groups who can read shared objects via Salesforce API. For an example if I have a public group called group1 (with users in it) and if I have shared PublicGroup1 with role "Western Sales Team" can I get this information with API?

User-added image

I tried with UserShare table and as a result of query,
"SELECT Id, UserOrGroupId, UserId, User.Name, User.Id FROM UserShare"

I can see two entries and those are releted to the two members of PublicGroup1 (record.UserId). The record.UserOrGroupId is also present but I can't identify what is it. i.e value of it 00Gi0000002Sp21EAC and when I ask to retrieve,
http://<salesforce_url>/00Gi0000002Sp21EAC it gives me unsufficient permission error.

So here how can I get 'Western sales team' information (role id) as users/groups/role who can read information about PublicGroup1?

Regards.