conditionally hide a field based on another field's value (without using templates) I have a content type which has a required field containing some personal information like an email address. This field is not on the user entity - it is on an arbitrary content type.

What I need to do is conditionally hide or show this value based on whether the user consents for this information to be shown publicly.

I know that this can be done by creating a second boolean field ("show information" or similar) on the content type, and then overriding the theme template. The problem is that I am using a number of different view modes (via displaysuite) and do not want to have to override them all individually. I've tried calling hide() in hook_node_view with no success. I also can't just hide the value with jquery/css, since this field contains personal information and I can't output it at all if the user doesn't consent.

Is there a way to do this using display suite or a custom module? Is there a common solution to this that I'm overlooking?
Implement hook_field_access($op, $field, $entity_type, $entity, $account).

To find out how the arguments are structured, var_export() them in your first implementation (or better yet, dpm() them).