Condition on approvals visibility

I have set Add approval checkbox on my status and whenever user is in approval group, the approve/decline buttons show up. However I would like to hide in certain situations based on condition.
I would like to keep from using javascript and getting ID of element from DOM and remove this way by setting display:none. I need condition in java postfunction or in scriptrunner but someway don’t know how to implement. Can you help me?