Replace hardcoded hiding prevention check with an attribute