SalesforceLabs / survey-force

85 stars 61 forks source link

Chatter post visibility problem #48

Closed friscoandy closed 4 years ago

friscoandy commented 4 years ago

I added a Chatter component to the lightning record page for the Survey Taken page. This way, if there is poor feedback on a case that the survey is tied to, I can @mention one of my support agents and ask them to follow back up on the case. The problem is that my chatter posts are publicly visible via the Company Highlights feed in Chatter and on my profile page. As I investigated the issue, I learned this was because the OWD on the Survey and Survey Taken objects had been set to Public. Chatter comments posted directly on record pages should only be visible by whoever has access to that record. In my case, everyone had access because it was set to Public. When I changed both the Survey and Survey Taken object OWD to Private, this fixed the issue of the visibility to the Chatter posts. However, setting the OWD to Private caused an error when users tried to take the survey. It seems they can only take the survey if the OWD on the Survey object is Public read/write. I still have the OWD on the Survey Taken object set to Private and my Chatter component is on the Survey Taken record page but my Chatter posts continue to show up as public posts on the Company Highlights feed in Chatter, on my profile, and in the feed of anyone who is following me. What do I need to do to ensure that users can still take and submit the survey but the chatter comments are private on the survey taken page?

jrattanpal commented 4 years ago

It has to be Public Read/Write for someone else to be able to view a survey created by some other user. And because it's master-detail relation with "Survey Question Response", it has to be read/write so Guest user can write to that object.

You can always copy the "TakeSurvey" page and add a Chatter component for internal page but not on the external page.

Does that work for you?

friscoandy commented 4 years ago

I'm not sure what you mean. Here is a short video showing how we implemented your tool and where the problem is: https://andyshelton.tinytake.com/tt/MzkzNjQ0Ml8xMjA4MDY1MQ

jrattanpal commented 4 years ago

If "Survey Taken" object is "Public Read/Write" then anyone can see it. If you make that object private then only the users who you give access to (or the record owner) can see it.

As for Chatter post showing in those feeds, yes, that's how it works. Chatter will show up everywhere.

But, if a user doesn't have access to that object/record then it will be hidden when they see your feed. If you can see your chatter post while logged in as a user who doesn't have access to that object/record then you need to check security again. it maybe somehow they still have access to that record; without access they cannot see that chatter post (that's fundamental SF security and cannot break)

friscoandy commented 4 years ago

OK, I think it is working as expected now. I made the Survey Taken object "Private" and now only the person who submitted the survey can see Chatter posts made on the Survey Taken record. Thanks! One other question...I am trying to create a process builder on the Survey Question Response object that notifies my supervisor if any negative feedback is received through the survey. One of the questions on the survey is "Was your issue resolved" and if they answer "No" I want that value to trigger the process. I can't get it to work. Can you watch this quick 2 minute video and tell me if I have it set up correctly? https://andyshelton.tinytake.com/tt/MzkzNjYyM18xMjA4MTI1OA

jrattanpal commented 4 years ago

Sorry, I am not sure how your questions are setup. or without being able to debug (which I can't).

It's definitely a config issue so make sure your condition is correct. Start small, for example, post to chatter when condition is true to confirm it's working. Then go from there. This way you can see the steps where the error is.

I think this also shows up in debug logs so you can see where it's failing in the log