Issues with Role Inheritance when extending sys_user_group and sys_user_grmember
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I am working on a requirement where I have extended sys_user_group into a custom table u_team and sys_user_grmember into u_team_member. My goal is to have roles automatically synchronized to users when they are added to u_team_member, similar to how the standard Group-Member relationship works.
I have implemented a Business Rule and Script Include to manually manage these roles in the sys_user_has_role table. However, I am facing two major issues:
Role Deletion Conflict: If a user belongs to both a standard Group and a custom Team, and both entities provide the same Role A: When I remove the user from the Team, my script deletes Role A from the user's profile, even though they should still retain it via the standard Group membership.
Inheritance Map issues: * If I set
inherited = truein my script, I struggle to keep it synced with the platform's native logic.If I set
inherited = false, the Inheritance Map tool does not show the relationship, making it hard to audit where the role came from.
My questions are:
Is it feasible to make a custom table extended from
sys_user_grmemberbehave exactly like the out-of-the-box one regarding role inheritance?How does the Inheritance Map mechanism work under the hood? Does it only track records explicitly linked via
sys_user_grmember? Are there any official documents or deep dives into how the platform work with Inheritance Map (I'm a ServiceNow newbie)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @tomato20250,
I'm not sure I understand this correctly... but you can create a new group, assign your role (custom or ootb) to that group and then you just add or remove the group members and it is all done automatically. You don't need to do anything else.
If you want to control this via script, still create that group with a required role and then just add people to the group...
Please provide the scenario what you expect to happen and what happened instead. Perhaps I haven't had enough coffee to start my brain 😛 let's discuss the next steps
100 % GlideFather experience and 0 % generative AI
