Read only access to KB Article not working

XYZ
Tera Contributor

Hello Community,

There is a requirement to create kb article with certain users should have read access to the kb article.

 

I created the kb article, created the user criteria and mapped into can read user criteria.On testing I can see the user criteria is not working. The user not added into that criteria is also able to see.

 

How can we make it work ??Where I have to check?? Is it possible to make it work through ACL??Let me know the possibilities.

 

Thanks!

 

 

3 REPLIES 3

SN_Learn
Kilo Patron
Kilo Patron

Hi @XYZ ,

 

You can create a user criteria on the Knowledge level.

The fields are not visible on the form. So, we have to pull them out using configure > Form Builder/Form Design and search for 2 fields named 'Can read' and 'Cannot read'. Now, we will add the user criteria in this field.

 

 

Example:

SN_Learn_1-1721968872076.png

 

SN_Learn_2-1721968935175.png

SN_Learn_3-1721968958993.png

 

In 'can ready', simple create a user criteria(in it add users/roles/group/etc) and add it.

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

Bhavya11
Kilo Patron

Hi @XYZ ,

Basically,If Can Read is empty, everyone should have access to read the Knowledge articles for that Knowledge Base.

OOTB, there is an "All Users" user criteria defined which has no location, group, user, etc. defined. It's basically an open access. If you put that in the Can Read for the Knowledge base, does this allow the users to see the article. If not, check ACLs.


Please check the User Criteria Diagnostics  you will get to know that why User Criteria is failing 

 

 

Please mark helpful & correct answer if it's really worthy for you.

 

 

Thanks,

BK

 

 

XYZ
Tera Contributor

Hello @Bhavya11 ,

 

I went through the user criteria diagnostics and it has read access

 

XYZ_0-1721972209958.png

 

I went through the ACL in kb_knowledge for read role, and it seems we dont have any acl defined specifically for user criteria.

 

What we are looking for is how we can restrict kb with kb role - itil and user criteria mapped in can_read_user_Criteria should only have access to the article.The user can be end user/ IT people.

 

Please help me how I can achieve the same through ACL??

Current ACL we have is:-

 

if (current.isNewRecord()) {
    answer = true;
}

if (current.author == gs.getUserID()) {
    answer = true;
}

if (current.roles.toString() == "itil") {
    if (gs.getUser().isMemberOf(current.u_knowledge_management_group)) {
        answer = true;
    }

   
    var availableGroup = new GlideRecord('u_m2m_groups_knowledge');
    availableGroup.addQuery('u_knowledge', current.sys_id);
    availableGroup.query();
    if (availableGroup.hasNext()) {
        while (availableGroup.next()) {
            if (gs.getUser().isMemberOf(availableGroup.u_group)) {
                answer = true;
            }
        }
    } else {
        if (gs.hasRole('itil')) {
            answer = true;
        }

    }

   
}

if (current.roles.toString() == "public" || gs.hasRole('knowledge')) {
    answer = true;
}

var gr1 = new GlideRecord("sysapproval_approver");
gr1.addQuery("document_id", current.sys_id);
gr1.addQuery("approver", gs.getUserID());
gr1.query();
if (gr1.next()) {
    answer = true;
}