I need help with a script permission

I need help how to make a permission for a script be like: Only X job/group can use the script

Add a if structure that checks the permission of the user before do the thing that you want to restrict :face_with_monocle: