- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2019 03:40 AM
Hi,
I would like to create a Business rule to allow acces to particular RITM to a particular role
To be clear, role "onboarding_user" must only see the "Onboarding" requested item.
This is my Business rule:
Query
Table: sc_req_item
Conditon: current.cat_item.name == "Onboarding"
(function executeRule(current, previous /*null when async*/) {
if (!gs.hasRole("onboarding_user") && gs.isInteractive()) {
var u = gs.getUserID();
var qc = current.addQuery("opened_by", u);
gs.print("query restricted to user: " + u);
}
})(current, previous);
I don't know why when i add the condition current.cat_item.name == "Onboarding" it's doesn't work
Any idea ?
Regards,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2019 07:34 AM
Hi,
I've find a very simple way to do that:
Business rule:
Query
table: sc_req_item
(function executeRule(current, previous /*null when async*/) {
if (!gs.hasRole("user_role") && gs.isInteractive()) {
current.addQuery("cat_item","!=","sys_id_of_cat_item");
}
})(current, previous);
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2019 03:56 AM
Good Day,
Why don't' you try out of box system functionality for this. Go on that item and add the role like onboarding_user.
if you're not able to view role field then check UI policy or client script.
Hope this should work.
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2019 05:02 AM
I don't see roles option in Catalog item. I checked BR and client script but there is no way to display this option.
It's why I want to do that by BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2019 05:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2019 05:32 AM