You are here

function _commerce_backoffice_product_node_add_product_access in Commerce Backoffice 7

Checks whether the user has permission to add a product reference node.

1 string reference to '_commerce_backoffice_product_node_add_product_access'
commerce_backoffice_product_menu in ./commerce_backoffice_product.module
Implements hook_menu().

File

./commerce_backoffice_product.module, line 483

Code

function _commerce_backoffice_product_node_add_product_access() {
  if (user_access('administer content types')) {
    return TRUE;
  }
  foreach (commerce_product_reference_node_types() as $type) {
    if (node_hook($type->type, 'form') && node_access('create', $type->type)) {
      return TRUE;
    }
  }
  return FALSE;
}