How to restrict UI action button for Particular Related List/List Control

Harish Kota2
Tera Contributor

I want to show the UI Action Related list for limited groups only and for Admins as well.

I have written the below code in 'omit new button'.

!gs.getUser().isMemberOf('assignment_group') || !gs.getUser().isMemberOf('assignment_group') || !gs.getUser().isMemberOf('assignment_group') || !gs.getUser().isMemberOf('assignment_group') && checked with || as well  !(gs.hasRole('admin'));

the above code is working for mentioned groups but not for Admins, Admins are not able to see the New button.

My Requirement is Admin and the mentioned group members only should see the New button as per the screenshots.