• Shraddha Aher
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hi,

I am getting following error when I run my test class:

System.QueryException: Insufficient access rights: you cannot access draft articles.

The line for which it gives error is:

String q = 'select ' +pkb_Controller.join(pkb_Controller.kavFields, ',')+ ' from KnowledgeArticleVersion where Id = \'' +kavObj.get('Id')+  '\' and PublishStatus = :publishStatus';
kavObj = (KnowledgeArticleVersion)Database.query(q);

here I am trying to query the 'KnowledgeArticleVersion' object and I am getting the error.
How to give access for this object ? I am system administrator so should have the access by default.