You are here

function bean_add_page_access in Bean (for Drupal 7) 7

Access callback for the general Bean add page (block/add).

1 string reference to 'bean_add_page_access'
bean_menu in ./bean.module
Implements hook_menu().

File

./bean.module, line 780
Block Entity

Code

function bean_add_page_access() {
  if (user_access('administer bean types') || user_access('administer beans')) {
    return TRUE;
  }
  foreach (bean_get_types() as $bean_type) {
    if (entity_access('create', 'bean', $bean_type->type)) {
      return TRUE;
    }
  }
  return FALSE;
}