logo

NJP

In a public Knowledge Base, make an article visible to ESS users but not unauthenticated users

Import · Jan 30, 2012 · article

One limitation of making the Knowledge Base public is that you lose the distinction between an ESS user (without roles) and a user who is not logged in. You can't have an article that Joe Employee can see that the Guest user cannot.While explaining this for the 3rd time in the last 12 months, I had a thought. You could probably:1) create a new boolean on kb_knowledge, call it u_login_required2) set this field true for articles without roles that you don't want unauthenticated users to see3) add a "before query" rule to kb_knowledge that says if you're not logged in, records where u_login_required is true get filtered out of the result set.For the rule in 3), the condition would be:

gs.getUser().isDefault()

And the script would be:

current.addQuery("u_login_required", false);

I haven't tested this (I spent my time writing it up instead), but I can't think of a reason why it wouldn't work. If anyone interested in doing this actually tries it and finds it doesn't work, lemme know image

View original source

https://www.servicenow.com/community/in-other-news/in-a-public-knowledge-base-make-an-article-visible-to-ess-users/ba-p/2280626