RITM access only with a particular role

BenG
Tera Guru

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,

1 ACCEPTED SOLUTION

BenG
Tera Guru

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,

 

 

View solution in original post

5 REPLIES 5

BenG
Tera Guru

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,