I want to give access to KB Managers to add articles as Featured Content like KB admin

Sachithananda 1
Tera Expert

I want to give access to KB Managers to add articles as Featured Content ike KB admin but New UI button on Featured Content related list on Knowledge Base is missing for KB managers

KB ADMIN view:-

Sachithananda1_0-1768839870359.png

 

KB Manger view:-

Sachithananda1_1-1768839870360.png 

 

configuring list contraol giving following new page 

Sachithananda1_2-1768840048646.png

 

 

1 ACCEPTED SOLUTION

Chaitanya ILCR
Mega Patron

HI @Sachithananda 1 ,

 

OOB only users with "knowledge_admin" role or the users in the 

owner or manager field are allowed to add the featured content

ChaitanyaILCR_0-1768841965147.png

 

if you want to give access to users with knowledge_managers role

create an ACL and with create access to table kb_knowledge_keyword

you will be able to see the "New" UI action

ChaitanyaILCR_1-1768842195694.png

 

also create read and write ACLs if required same as the create operation

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

 

View solution in original post

2 REPLIES 2

Chaitanya ILCR
Mega Patron

HI @Sachithananda 1 ,

 

OOB only users with "knowledge_admin" role or the users in the 

owner or manager field are allowed to add the featured content

ChaitanyaILCR_0-1768841965147.png

 

if you want to give access to users with knowledge_managers role

create an ACL and with create access to table kb_knowledge_keyword

you will be able to see the "New" UI action

ChaitanyaILCR_1-1768842195694.png

 

also create read and write ACLs if required same as the create operation

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

 

Hi @Sachithananda 1 ,

 

if you want to customize it 

there is a OOB script include named "KBKnowledgeKeyword"

ChaitanyaILCR_1-1768895946460.png

 

update the script include as below 

if it's already updated in your instance just update the methods as highlighted 

 

 

KBKnowledgeKeyword = Class.create();

KBKnowledgeKeyword.prototype = Object.extendsObject(KBKnowledgeKeywordSNC, {

    /**
     * If the user is a owner/ manager of the KB or knowledge_admin 
     * they should be able to create kb_knowledge_keyword record
     *
     * @param GlideRecord: knowledgeKeywordGr
     * @return Boolean: can logged in user pin an article
     */
    canCreate: function(glideRecord) {

        if (gs.hasRole("knowledge_admin"))
            return true;
        if (glideRecord.getRecordClassName() === "kb_knowledge_keyword" && gs.hasRole('knowledge_manager')) {
            return true;
        }
        //check can create for table list view and for new record from kb_knowledge_keyword
        if (glideRecord === null || typeof glideRecord === "undefined" || glideRecord.getRecordClassName() === "kb_knowledge_keyword") {
            return new KBKnowledgeBase().isManagerOfAny(gs.getUserID());
        }

        //check can create for related list view on kb_knowledge_keyword record
        var className = glideRecord.getRecordClassName();
        if (className == "kb_knowledge" || className.startsWith('kb_template') || className.startsWith('u_kb_template')) {
            var kbKnowledgeKeyword = new GlideRecord("kb_knowledge_keyword");
            if (kbKnowledgeKeyword.get("knowledge", glideRecord.sys_id))
                return false;

            return this.isKnowledgeBaseOwner(glideRecord, this.PATH_TO_OWNER_FROM_KNOWLEDGE) || this.isKnowledgeBaseManager(glideRecord, this.PATH_TO_MANAGERS_FROM_KNOWLEDGE);
        }

        //check can create for related list view on kb_knowledge_base record
        if (glideRecord.getRecordClassName() == "kb_knowledge_base") {
            return this.isKnowledgeBaseOwner(glideRecord, this.PATH_TO_OWNER_FROM_KB) || this.isKnowledgeBaseManager(glideRecord, this.PATH_TO_MANAGERS_FROM_KB) || gs.hasRole('knowledge_manager');
        }

        return false;
    },
    /**
     * If the user is knowledge_admin or owner/ manager of the KB
     * they should be able to write
     *
     * @param GlideRecord: knowledgeKeywordGr
     * @return Boolean: can logged in user read the record
     */
    canWrite: function(knowledgeKeywordGr) {
        if (gs.hasRole("knowledge_admin") || gs.hasRole('knowledge_manager'))
            return true;

        if (knowledgeKeywordGr.isNewRecord())
            return this.canCreate(knowledgeKeywordGr);

        return (this.isKnowledgeBaseOwner(knowledgeKeywordGr, this.PATH_TO_OWNER) ||
            this.isKnowledgeBaseManager(knowledgeKeywordGr, this.PATH_TO_MANAGERS) || gs.hasRole('knowledge_manager'));
    },

    type: "KBKnowledgeKeyword"
});

 

 

additional step 

if the record (kb_knowledge_keyword)is not editable 

create a DenyUnless ACL like this

 

ChaitanyaILCR_0-1768895896700.png

 

 

and you can ignore the last ACLs that you have created 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya