How to show UI action to only few Roles

Purushotham9963
Tera Contributor

Hi ,

i have created one UI Action on incident Table to created child tasks. and the Button ' create task' should be visible to only for few users who is having few custom roles.

And i am aware that we can achieve this if we give"gs.hasRole('contract_manager')  " in the condition field in UI action. But since we have many conditions we do not have any space left to give this in the condition field.

Can anyone please help me with the script to achieve this?