For one of my integrations project, I am trying to repurpose the Salesforce record sharing model outside Salesforce.

I have been following this article which talks about identifying access for user using join of following three tables: Object table example: Case, Object share table example: CaseShare and GroupMaintenance tables which I understand doesn't exist and I assume Salesforce creates dynamically using Roles, RolesandSubordinates and RolesSubordinatesInternal tables.

My problem is when I try to create this third groupmaintenance table myself and try to find members of groups of the type "RolesandSubordinates", I get zero results from GroupMember table. Reading the documentation of Salesforce, it says GroupMember will only return direct members of the group. Hence, I am unable to fetch members of groups of the type: roleandsubordinates.

Am I doing something wrong? Any help is much appreciated!!

  • 1
    Hi Manpreet, i dont have much idea about your current problem regarding custom creation of groupmaintenance table. but wanted to understand your use case. why do you need to reimplent sharing model again in another system? if by any chance your use case is to check if given user has access to particular record or not you can use userRecordAccess Object. it will consider complete sharing model. developer.salesforce.com/docs/atlas.en-us.object_reference.meta/… Jan 14 at 17:13
  • Easier: model the whole thing in SF, have your app call SF to see if user X is authorized to see/perform Y.
    – identigral
    Jan 14 at 17:34
  • Hey @gauravsharma I dont have record ids to query userRecordAccess, all i have is userid. Jan 14 at 19:19
  • what is the exact use case you are trying to solve which require reimplementing sharing logic in another system? Jan 14 at 19:28
  • Hi Gaurav, I am trying to serve Salesforce records as part of a centralised search index (which is outside Salesforce and has data from other platforms as well). So, I need to make sure I am showing only those records in search results which user has access to. This is the reason, I need to ensure I apply Salesforce sharing model on records in my index and prebind access control in search results. Jan 16 at 15:22


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.