Knowledge versioning - modifiy roles (users) that can make minor edits

Ken24
Giga Expert

Hi all, we enabled the Knowledge Management "enable minor edits to published article without creating a new version" property.  And added fields to the "List of fields (comma-separated) that can be edited on published articles without creating a new version."  valid_to,short_description,text.  In  for Article versioning properties, there is a Note: This feature is available for the following users: the knowledge administrator, the knowledge base manager, and the knowledge base owner.    

This works. However, we would like to allow the Author of the KB article to make the same minor edits.   

Any ideas?

Thanks, Ken

1 ACCEPTED SOLUTION

Ken24
Giga Expert

Hi, I did, but I dont remember who to give credit to.   I think I searched the community for "glide.knowman.versioning.minor_edit_fields" and found something. 

There is a script include KBVersioningSNC that checks the user roles (where the above sys property is used).  It can be overrode with script include "KBVersioning"  as below

 

Ken

 

var KBVersioning = Class.create();

....

hasAnyElevatedAccess: function(current){
var PATH_TO_AUTHOR = current.author; // is author mod
var PATH_TO_CURRENT_USER = gs.getUser().getID(); // is author mod
var PATH_TO_OWNER = "kb_knowledge_base.owner";
var PATH_TO_MANAGERS = "kb_knowledge_base.kb_managers";
if (gs.hasRole("knowledge_admin"))
return true;

if (this.isKnowledgeBaseOwner(current, PATH_TO_OWNER))
return true;

if (this.isKnowledgeBaseManager(current,PATH_TO_MANAGERS))
return true;

if (PATH_TO_AUTHOR == PATH_TO_CURRENT_USER) // is author mod
return true; // is author mod

return false;
},

type: 'KBVersioning'
});

View solution in original post

4 REPLIES 4

eadler
Tera Expert

Did you ever figure out a solution?  I'm facing the same request right now.

Thanks!

Ken24
Giga Expert

Hi, I did, but I dont remember who to give credit to.   I think I searched the community for "glide.knowman.versioning.minor_edit_fields" and found something. 

There is a script include KBVersioningSNC that checks the user roles (where the above sys property is used).  It can be overrode with script include "KBVersioning"  as below

 

Ken

 

var KBVersioning = Class.create();

....

hasAnyElevatedAccess: function(current){
var PATH_TO_AUTHOR = current.author; // is author mod
var PATH_TO_CURRENT_USER = gs.getUser().getID(); // is author mod
var PATH_TO_OWNER = "kb_knowledge_base.owner";
var PATH_TO_MANAGERS = "kb_knowledge_base.kb_managers";
if (gs.hasRole("knowledge_admin"))
return true;

if (this.isKnowledgeBaseOwner(current, PATH_TO_OWNER))
return true;

if (this.isKnowledgeBaseManager(current,PATH_TO_MANAGERS))
return true;

if (PATH_TO_AUTHOR == PATH_TO_CURRENT_USER) // is author mod
return true; // is author mod

return false;
},

type: 'KBVersioning'
});

mikeib182
Tera Contributor

@Ken24 Would you know if this is possible by specifying a specific role? I'm assuming they can since knowledge_manager is a role. Would be nice to specify a different role like if(PATH_TO_KCS_ROLE == PATH_TO_CURRENT_USER) return true;

I ended up needing similar requirements for this, but since hasAnyElevatedAccess touches on a bunch of stuff I don't necessarily want authors to have access to, I instead decided to adjust just the canWrite function utilizing the PATH_TO_AUTHOR and PATH_TO_CURRENT_USER variables.

Moving it from:

return ((this.hasAnyElevatedAccess(current) || this.isMemberOfValidGroup(current, this.OWNERSHIP_GROUP)) && this.getEditableFields() != ''))


To:

return ((this.hasAnyElevatedAccess(current) || this.isMemberOfValidGroup(current, this.OWNERSHIP_GROUP)) && this.getEditableFields() != '' || (PATH_TO_AUTHOR == PATH_TO_CURRENT_USER && this.getEditableFields() != ''));


Now authors have the ability to do minor edits without giving them unintended access elsewhere.