3

I have a generic platform event for Record updates. (RecordChange__e)

I am firing that event in apex and subscribing it in an aura component in LEX.

It's working fine for me and other System Admins. But not working for other Users (like Call Center Agents who use service console, where empAPI is housed).

Are there any obvious permissions I am missing?

3
  • 1
    How are other users accessing the component? On desktop, mobile?
    – Jayant Das
    Nov 26, 2019 at 20:07
  • are those user's profile API enabled? Nov 26, 2019 at 20:17
  • Yes! That Profile is API enabled.
    – Nithesh N
    Nov 26, 2019 at 21:51

1 Answer 1

11

It is in-fact a permission issue. Since, Platform events are also sObjects. I needed to give read permission to that sObject in the permission set for that profile.

for debugging, I added an error callback to empApi

const empApi = cmp.find("empApi");
empApi.onError($A.getCallback(error => {
    console.error('EMP API error: ', JSON.parse(JSON.stringify(error)));
}));

Then, I got this error..

{
    channel: "/meta/subscribe"
    clientId: "3ka14r4jh9wtgreco75x81z39t2j"
    error: "403:denied_by_security_policy:create_denied"
    id: "579"
    subscription: "/event/RecordUpdate__e"
    successful: false
}

Thanks to @jayant-das's answer in this forum post. I was able to figure it out.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .