Iterate through all children of an element
A simple recursive function will do the trick:

function allow_access(&amp;$root_element) {
  $root_element['#access'] = TRUE;
  foreach (element_children($root_element) as $key) {
    allow_access($root_element[$key]);
  }
}
allow_access($form);