In my organization, users in Communities are currently associated with a single account. When users are created, they are given a unique user name and contact. This has worked well in that the Communities Sharing Set has bound between user contact and the standard contact object. The person who owns their cases sees only their cases.

Today, I've been asked to find a solution to share records in communities with users who have the same account, while maintaining the security for the rest of the organization. Effectively, it is something like this:

Alice, Special Account = Special User
Bob, Normal Account = Normal User
Joe, Special Account = Special User

Alice can see Alice and Joe's cases, but not Bob's. Bob can see only Bob's cases.

Normally, I believe I'd accomplish this with partner licenses. But since I don't have those, I am thinking of doing something like (in psuedocode):

New Field: CommunityPartner –Boolean


If (Account in [list of accounts])
     CommunityParnter = true;


Foreach (case owned by AccountWithCommunityPartnerTrue)
     //Share case with all other users from this account that have the right profile

Does this sound like a viable solution? Is there another way to accomplish this?

  • 1
    Can you clarify, you only have Customer Communities licenses? You do not intend to purchase Partner Community licenses? – greenstork May 5 '14 at 19:59
  • Correct. Cannot buy them. :( – Darkenor May 5 '14 at 20:10
  • If you can not use the manual sharing rule for your communities licenses, also you can not use the code to do this. – Jair Jun 5 '14 at 3:30
  • Has anyone found a solution to this? I am in a similar situation. – Ming Feb 11 '16 at 23:35

This can be accomplished with Sharing Sets. Customer communities users do not have access to the full sharing model but can share records in a limited way using sharing sets and groups. These sharing tools basically allow for sharing of any object accessible to the Customer Community license between users on the same account, determined by an account lookup on the object. Since your case has a lookup to the account associated with the communities users, you should be able to create the sharing set based on this lookup. Here are the specific instructions for doing so:


|improve this answer|||||
  • 1
    then you're out of luck, Only partner community licenses have access to the sharing model and only the full sharing model can use apex for criteria based sharing. – greenstork May 5 '14 at 20:54
  • 1
    It's not quite fair for you to mark my question -1 since there is nothing in your original question that indicates you don't want to share some cases via lookup. You question only asks how would you share cases related to the same account, which my answer clearly addresses. – greenstork May 5 '14 at 20:56

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.