this._knowledgeHelper.canRead(knowledgeGR) function not returning record as expected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2018 12:03 PM
In the Script Include KBKnowledge, I have copied and pasted the canRead: function(knowledgeGR) function from KBKnowledgeSNC because it seemed to be the function where I was finding the problem.
Indeed, when I commented out various parts of the function, the problem became clear.
When I did the below comment, the record showed up for the user I was testing with.
if (/* this._knowledgeHelper.canRead(knowledgeGR) && */
(knowledgeGR.workflow_state == 'published' ||
knowledgeGR.workflow_state == 'outdated' ||
this._knowledgeHelper.canReadUnpublished(knowledgeGR))) {
The natural reaction is to say that the user doesn't have read access to the article; however, the article is in a knowledge base which is open to the public (i.e., the CanRead user criteria on the knowledge base is empty).
I cannot seem to find the code behind _knowledgeHelper.canRead anywhere.
Anyone have any suggestions on how I can further troubleshoot this?
I will also note that I am viewing the record through the Knowledge Feedback table, if that makes a difference.
- Labels:
-
Knowledge Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2018 11:01 PM
Through class inheritance you will find _knowledgehelper in the KBCommonSNC script include.
KBCommonSNC.prototype = {
VERSIONING_PLUGIN : 'com.snc.knowledge_advanced',
initialize: function() {
this._knowledgeHelper = new SNC.KnowledgeHelper();
},
I don't think we can see the code within canRead() since it's core code.
I assume it checks the user criteria at the article level but it may also check at the Knowledge Base level aswell.
Although this post contains info specifically about canContribute() it is helpful.
"It is not implemented in a Script Include, this is core application code that is exposed to scripting via an interface. canContribute will return true if the user is admin, is the owner or manager of that KB, or if that user has a matching user criteria. The wiki article says that if there are no user criteria any ESS user can contribute but the code seems to contradict that."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2018 07:57 AM
Correct, we cannot see the code.
Seeing that canContribute references admin, owner, or manager is consistent with my findings (those three 'roles' can also view the appropriate feedback records); however, I do not believe it is accurately determining if the user has a matching user criteria record.
I have submitted INT3675324 in the HI Service Portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2020 11:18 AM
Hi Eric,
I also think it is not working for matching user criteria. What was the outcome from HI Portal?
Could you please let me know?
Thanks& Regards,
Mithun K R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2021 02:08 AM
Hi
What is the solution proposed for this..as we are looking for similar issue. Help here!