applying UI Policy only for specific user group

ody
Tera Contributor

Hi,

how to write a filter condition based on current user group membership when applying UI policy.
the filter condition is: if current user is member of group X, then do apply some UI policy

I found a code snippet:
if(gs.getUser().isMemberOf(group_X_sys_id)){
//Do something...
}

but how do I put the code into the condition filter box?

 

 

Thank you

16 REPLIES 16

Use client script to achieve this. 

Write below code in Display BR. inside isMemberOf() provide sys_id in quotes

g_scrathpad.isMember = false;
if(gs.getUser().isMemberOf(group_X_sys_id)){
g_scrathpad.isMember = true;
}

Write below code in onLoad client script

if(g_scrathpad.isMember){
g_form.setReadOnly('text_field_name',true);
}

when to run the BR? is it on Display, Before, After or Async?

Display

In Display business rule there is no before or after. It always runs when form is just loaded. Just select display BR.

YEs only display business rule