UI Action Button visible only to people of a specific group

Alessia Russo
Tera Expert

Hi everybody! I've created a ui action button, but I want that button shows only for specific people, so maybe for groups. I've tried to use some script on the condition but nothing seems to work, here some of the script in the condition that I've used:

 

1) current.state == 1 && (gs.getUser().isMemberOf(current.assignment_group == '445334299780e1981fadb6e3f153aff2' )) || (gs.getUser().isMemberOf(current.assignment_group == 'bc2370e59780e1981fadb6e3f153afca'))

 

2) current.state == 1 && (gs.getUser().isMemberOf(assignment_group == 'Test1' )) || (gs.getUser().isMemberOf(assignment_group == 'Test2'))

 

3) current.state == 1 && (gs.getUser().isMemberOf('Test1' )) || (gs.getUser().isMemberOf('Test2'))

 

Somebody could tell me how to resolve it? When I try to impersonate people of other groups(so not people part of group test1 and not of group test2) I see the button anyway when I shouldn't. Any suggestion?

Thanks

 

1 ACCEPTED SOLUTION

Johns Marokky
Tera Guru

Hi @Alessia Russo ,

Almost whatever you are doing is correct, only braces caused problems i think.

try the below in condition.

current.state == 1 && (gs.getUser().isMemberOf('Test1' ) || gs.getUser().isMemberOf('Test2'))

 

Mark helpful if it helps in solving your query.

Regards,

Johns

View solution in original post

2 REPLIES 2

Johns Marokky
Tera Guru

Hi @Alessia Russo ,

Almost whatever you are doing is correct, only braces caused problems i think.

try the below in condition.

current.state == 1 && (gs.getUser().isMemberOf('Test1' ) || gs.getUser().isMemberOf('Test2'))

 

Mark helpful if it helps in solving your query.

Regards,

Johns

thank you! now it works!