control the view access permissions by field.tpl.php in D7 I would like to be able to control who can view a field by a custom field.tpl.php for a given field. Basically I would like to set a coditional at the beginning so that is displays nothing if the user does not have a given role (say, "registered-user").
I would think that this amounts to adding an "if" at the very beginning of the the field template, but I do not have much experience. 
Is it possible to do it that way?
Never put any business logic into tpl files. They can be cached. So unless it's the &quot;if odd, add class odd&quot; type of logic, it may fail you miserably.
If you need more elaborate rules than Field Permissions give you, you need to implement hook_field_access($op, $field, $entity_type, $entity, $account) in your custom module.

Return value
TRUE if the operation is allowed, and FALSE if the operation is denied.

Field Permissions module is open source. You can see it's source to learn how this hook is supposed to be used. Same with User role field module. Both are pretty well commented in code, and can serve as good examples how to write your own custom logic. Just make sure you are not forking one, this may lead to more complications than it's worth - if they are not sufficient, inspire and even copy parts of code, but use your own name and info file.