How to prevent adding Business_stakeholder to a user that already has ITIL?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 01:08 PM
Good afternoon role experts!
I'm looking for the best way to prevent a user from having subscription licenses for both itil and business_stakeholder. We have some VIP's/CIO's who will start using business_stakeholder soon, but some of them already have the itil role because they inherit it from other APM related roles. We do manage roles through group assignments and there are several that contain business_stakeholder or itil.
I was thinking a business rule on sys_user_has_role to check if business_stakeholder is getting applied and then query to see if the same user already has itil- then set an abortAction with a message to investigate further.
If there's a better option than business rule- I'm open.
Thanks!
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2022 11:49 PM
Hi Adam,
Yes , write before BR on sys_user_has_role table and abort accordingly, Mark my answer as correct if that helps.
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2022 06:16 AM
i'm hoping for a little help on the script for the business rule. I can't seem to find a good example of checking for the gliderecord's user- most things look for currently logged in user.
i'd like to combine both possibilities in one rule if possible- if the user has b_s and itil is getting added, or the reverse.
in my condition, I tried without success:
current.user.hasRole('itil')&¤t.role=='business_stakeholder'||current.user.hasRole('business_stakeholder')&¤t.role=='itil'
Also- since the insert on sys_user_has_role comes from an action of adding to a group, is it possible to abort the action at this 'secondary' step?