you can use filter if your logic to hide is generic and applies for other actions too.
Add line below in your action tag.
<includeFilter name="<filter name>"/>
Also register the filter in enterprise.service.properties file
<Property name="wt.services/svc/default/com.ptc.core.ui.validation.SimpleValidationFilter/<filter name>/null/0" overridable="true" targetFile="codebase/com/ptc/windchill/enterprise/enterprise.service.properties" value="<full qualified name for filter class>/duplicate"/>
you can get more information in PTC customizer guide.