0

I have a custom Visualforce page that is displaying Cases to Salesforce Community Plus users. A custom controller has the keywords global with sharing and a global static method annotated with @RemoteAction is being called by the JavaScript referenced by the Visualforce page to get data to display to the User.

Some of the community users are able to see details about records based on the SOQL query being run by the controller but are unable to view those records. The records are owned by Users higher on the Customer Portal Role hierarchy.

The external sharing model has been enabled for the Salesforce org. The default external access for Cases has been set to 'Private'. Sharing does exist to open up visibility of Cases to users higher on the Customer Portal Role hierarchy.

I have also tried filtering Cases using the UserRecordAccess object related to the Cases but no difference was visible.

  • When you say "able to see details about records" and "unable to view those records", I get confused. Could you please provide more information on who can see what exactly? – Sander de Jong May 11 '15 at 6:59
  • Records appear in the SOQL query results that the user is unable to view the detail page for. Each Account has a Customer Manager Portal Role and a Customer User Portal Role. Cases are shared such that Managers can see the Cases owned by other Managers and Users. – beamso May 11 '15 at 10:09
  • 1
    @beamso Check the sharing for the case to see if things are working the way you expect. On the case, click Sharing, then Expand List, then locate a user you think shouldn't have access, then click Why? to find out why they have access. You may have a sharing rule in play that you didn't think would affect the user, or it may be implicit sharing from another record or another user. – sfdcfox May 11 '15 at 16:03
  • The sharing was working the way that I was expecting. The SOQL query was not. I had to test if the User had the Profile that we had associated with the Customer User Portal Role and run a query for those Users for the Cases that they owned, while all other users were able to use the previous SOQL query that respected their sharing. – beamso Jun 17 '15 at 1:08

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.