function _tripal_entity_add_access

3.x TripalEntityUIController.inc _tripal_entity_add_access()

A helper function for checking if a user can add Tripal Content.

This function is a callback for the bio_data/add menu path.

1 string reference to '_tripal_entity_add_access'
TripalEntityUIController::hook_menu in tripal/includes/TripalEntityUIController.inc
Overrides hook_menu() defaults. Main reason for doing this is that parent class hook_menu() is optimized for entity type administration.

File

tripal/includes/TripalEntityUIController.inc, line 788

Code

function _tripal_entity_add_access() {
  global $user;


  $types = tripal_get_content_types();
  foreach ($types as $type) {
    if (user_access('create ' . $type->name, $user)) {
      return TRUE;
    }
  }
  return FALSE;

}