Making a user as a group manager for group and giving that user access to add or remove group member
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-27-2023 06:59 AM
Hello Devs
I am having a requirement where they have stated is that Instead of granting a role we need to do something which will allow group managers to add or remove group members and yes there is manager field in group record
all i want to do is whatever user i put in that manager field that will be group manager and will be able to add or remove the group members
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-27-2023 07:19 AM
Hello,
For this you need to write an ACL on sys_user_grmember so that it only allows creation/deletion of record for that group when the user is the manger of the group.
Please follow the below post:-
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0753172
Please mark my answer as correct based on impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-27-2023 08:44 AM
Can you please tell me if it needs a script ? Could you pls explain the steps ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-27-2023 10:07 PM
Hello,
if you check the above post you will get the script but pasting the code directly here:-
Create Delete and Write ACL on table level (āsys_user_grmemberā)
check advanced
in script write below
if(typeof parent != 'undefined' && parent.manager == gs.getUserID()){
answer = true; //Allow access if user has 'user_admin' role or is group manager
}else{
answer = false;
}
Please mark my answer as correct based on Impact.