Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to create an ACL for current.parent.owner of a Knowledge article

Mike142
Kilo Explorer

Fairly new to the SN platform, so apologies for what I imagine is a straightforward question...

I am basically trying to create an ACL for the kb_cateogry Table for "create". I am trying to make it so only if the current user has the knowledge_admin role OR is current.parent.owner (current article Knowledge base owner). I was able to add "knowledge_admin" to the Requires Roles section but as for the current.parent.owner, I am somewhat at a loss. My guess is that I would need to write a script for this rather than using "Requires Role" ?

Any guidance would be greatly appreciated. Thanks!

2 REPLIES 2

Saurav11
Kilo Patron
Kilo Patron

Hello Yes you would need a acl script. Please find below the script which you can use:-

 

var user=gs.getUserID();
var own=current.parent.owner
if(own==user ) {
return true;
}else{
return false;
}

 

Hope this helps. Please mark the answer as correct/helpful based on impact.

Hello you did mark tge answer as correct and later changed it any reason why?