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
Big EarsBig Ears 

Communities "Sharing Sets" and their impact on "with Sharing" in Apex

I've read the documentation, but I wasn't entirely clear on a few things with "Sharing Sets" in Communities

1) Do they only apply to High Volume Portal Users, or all Communities users with the right Profile
2) If somebody is granted access to a record via a Sharing Set and then go to a VF Page with a "With Sharing" controller, will that Sharing Set be taken into account?

It seems like a major difference between Community and Community Plus licences in the documentation is that plus licences respect Sharing. However, Sharing Sets seem to then someway negate that advantage, if you can use them with standard Community licences and apex "with sharing".

Does anybody happen to know the details on this? Thanks!
Hi There,


Basically, within salesforce there is an order of importance in the sharing rules. Sharing sets allow you to share records that are otherwise private or not viewable.Firstly, you set the ORG wide sharing settings, then set role hierarchy (if thats the structure you have chosen) then you can add further rules to share your data.

An example would be a basic territory system for your company. E.G. All Accounts can be connected to a single office object (E.G. Office__c). There could be an office named Baltimoore, which has several accounts associated to it. You could set it in your sharing settings so only users from the Baltimoore office, can view baltimore clients.

The with sharing or without sharing (with sharing by default if you dont state either), will state whether or not your organisations sharing rules are taken into affect. You might use this if there is a page or system function that a user will use, which affects records that the user has no control of. Therego without sharing, will prevent the sharing rules from erroring when attempting to alter data.

I don't have much to do with communities, but i would say it would almost definitely follow the same rules of the platform.

Give us a like if I managed to audibly express myself.

I hope this helps.