Form API Field Permission I am creating a custom form and storing data in custom table. I was wondering if there is any method to apply field level permission like 

$form['value']['#permission'] = array('access this field');


I know I am having field permission module to apply permission on core fields but how I can achieve this?
I am already not try this but i think it will work 

function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {

  global $user;
  if ($form_id == 'FORM_ID') {
  if (in_array('yourrole', $user-&gt;roles)) {
  $form['your_field']['#access'] = FALSE;
    }
  }
}