You are here

function commerce_product_access in Commerce Core 7

Checks product access for various operations.

Parameters

$op: The operation being performed. One of 'view', 'update', 'create' or 'delete'.

$product: Optionally a product to check access for or for the create operation the product type. If nothing is given access permissions for all products are returned.

$account: The user to check for. Leave it to NULL to check for the current user.

5 calls to commerce_product_access()
commerce_product_handler_field_product_link_delete::render in modules/product/includes/views/handlers/commerce_product_handler_field_product_link_delete.inc
Render the field.
commerce_product_handler_field_product_link_edit::render in modules/product/includes/views/handlers/commerce_product_handler_field_product_link_edit.inc
Render the field.
commerce_product_ui_product_add_any_access in modules/product/commerce_product_ui.module
Access callback: determines if the user can create any type of product.
commerce_product_ui_product_uri in modules/product/commerce_product_ui.module
Entity uri callback: points to the edit form of the given product if no other URI is specified.
EntityTranslationCommerceProductHandler::getAccess in modules/product/includes/commerce_product.translation_handler.inc
Checks whether the current user has access to this product.
5 string references to 'commerce_product_access'
commerce_product_entity_info in modules/product/commerce_product.module
Implements hook_entity_info().
commerce_product_ui_menu in modules/product/commerce_product_ui.module
Implements hook_menu().
commerce_product_views_data in modules/product/includes/views/commerce_product.views.inc
Implements hook_views_data()
_commerce_product_match_products_efq in modules/product/commerce_product.module
Helper function for commerce_product_match_products().
_commerce_product_match_products_standard in modules/product/commerce_product.module
Helper function for commerce_product_match_products().

File

modules/product/commerce_product.module, line 613
Defines the core Commerce product entity, including the entity itself, the bundle definitions (product types), and various API functions to manage products and interact with them through forms and autocompletes.

Code

function commerce_product_access($op, $product = NULL, $account = NULL) {
  return commerce_entity_access($op, $product, $account, 'commerce_product');
}