0

I have the following code to get a Chatter Feed of a Case:

ConnectApi.FeedElementPage fep = ConnectApi.ChatterFeeds.getFeedElementsFromFeed(Network.getNetworkId(), ConnectApi.FeedType.Record, caseId, nextPageToken, RECENT_COMMENT_COUNT, null);

And everything works fine, except for the case when Knowledge Article with Data Category is attached to a Case using Knowledge component (on the screenshot) and the code mentioned above is executed by the user without access to this Data Category.

enter image description here

I get the following errors:

System.TypeException: Invalid conversion from runtime type ConnectApi.FeedItem to ConnectApi.FeedElementPage
System.TypeException: Invalid conversion from runtime type ConnectApi.EnhancedLinkCapability to ConnectApi.FeedElementCapabilities

I wanted to output text that this user does not have access to the article, but due to an error I can't do anything. Any ideas on how to fix this?

1 Answer 1

0

It's mega weird, but the problem wasn't access to the Data Category, it was the debug logging set for the user without access.

You must log in to answer this question.

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