- 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-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,