0

BACKGROUND

We have a trigger on the FeedItem (Chatter post) which uses a helper class:

public without sharing class FeedItemTriggerHelper
{
    public static void handleAfterInsert(List<FeedItem> chatterPosts)
    {
        System.debug([SELECT Id, Email, Name FROM User Where Id = '<user1Id>']);
        System.debug([SELECT Id, Email, Name FROM User Where Id = '<user1Id>']);
    }
}

When an external user (assigned to the Customer Community Login license) leaves chatter comment on a record in our Customer Community, the above code executes and user1 is not visible - the list is empty, and details for user2 are showed.

This is awkward since both user1 and user2 has the same User Licence - Salesforce, assigned to the same role in the role hierarchy. All sharing settings are on the screenshot below:

enter image description here

I checked manual sharing for both users and didn't see any sharing access.

QUESTION

As you can see from the code above the without sharing keywords were used, but that didn't help. I don't understand why with the private OWD for External Sharing, one user is visible, and the other isn't?

  • 2
    Check if by any chance a sharing set is configured for enabling this access – Raul Dec 7 '18 at 10:46
  • Can you clarify as what do you exactly mean by this -- [the above code executes and user1 is not visible - the list is empty, and details for user2 are showed]? Where is user1 not visible and user2 visible? Who are user1 and user2 in this context? – Jayant Das Dec 7 '18 at 13:53

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.