How to make author field editable for current Knowledge Base Members?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2024 07:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2024 09:47 AM
Hi @alok_071 ,
You can create ACL ( write ) for "kb_knowledge.author" and check for knowledge base membership in script part.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2024 10:24 PM
Hi @AshishKM ,
I have created the write ACl for author field with following advanced script but it's not working.
answer = false;
if (gs.getUser().isMemberof(current.kb_knowledge_base)){
answer = true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2024 06:44 AM - edited ‎01-24-2024 07:00 AM
Please refer the below link, isMemberof() method works for group based membership check, but here knowledge base managers field is a list collector type so its giving list of manager's sys_id with comma separated values,
Use the below code in advance script and test.
answer = false;
var baseMgrList = current.kb_knowledge_base.kb_managers;
var baseMgrSysId = [];
// split the comma separated list in to aarayList
baseMgrSysId = baseMgrList.split(',');
var arrayUtil = new ArrayUtil();
//the contain method will check the logged in user sys_id in arrayList
answer = arrayUtil.contains(baseMgrSysId,gs.getUserID());
Question-> as per the KB process stage ( Draft -- - - - > Publish ) , any further update required checkout and knowledge manger can update the author in new version of KB and re-submit for approval and then publish it. Why you need to edit this author update by know manager in state other than draft. I checked KB base managers can edit this author in draft but not in published state ( OOTB).
Note :
gs.getUser() -> Returns a reference to the user object for the current user.
gs.getUserID -> Returns the sys_id of the current user.
contains -> Searches the array for the specified element. Returns true if the element exists in the array, otherwise returns false.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2024 05:43 AM
please accept the solution and close this open thread.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution