I have a custom content type, Contacts. Under contacts I have a custom File field, Contracts.
I want to hide the any file that have been uploaded under the File Field, Contracts in the node edit form. It should be view-able only by the admin.
I want to display the upload option in the field to all the users, however, not the files that have already been uploaded under the node.
Please advice
Thanks
The modified code:
MODULE NAME = Hide_Uploaded_Files.
CONTENT TYPE = Candidates.
CUSTOM fIELD = field_resume.
<?php
function Hide_Uploaded_Files_form_alter(&$form, &$form_state, $form_id) {
global $user;
if ($form_id === 'Candidates_node_form' && !in_array('administrator', $user-
>roles) && $form['field_resume']['und'][0]['#default_value']['fid'] > 0) {
$form['field_resume']['#access'] = FALSE;
}
}
?>