function commerce_coupon_access in Commerce Coupon 7
Same name and namespace in other branches
- 7.2 commerce_coupon.module \commerce_coupon_access()
Checks coupon access for various operations.
Parameters
$op: The operation being performed. One of 'view', 'update', 'create' or 'delete'.
$coupon: Optionally a coupon to check access for. If nothing is given access permissions for all coupons are returned.
$account: The user to check for. Leave it to NULL to check for the current user.
Return value
bool
1 call to commerce_coupon_access()
- commerce_coupon_ui_coupon_add_any_access in ./
commerce_coupon_ui.module - Access callback: determines if the user can create any type of coupon.
2 string references to 'commerce_coupon_access'
- commerce_coupon_entity_info in ./
commerce_coupon.module - Implements hook_entity_info().
- commerce_coupon_ui_menu in ./
commerce_coupon_ui.module - Implements hook_menu().
File
- ./
commerce_coupon.module, line 137 - Coupon System for Drupal Commerce.
Code
function commerce_coupon_access($op, $coupon = NULL, $account = NULL) {
return commerce_entity_access($op, $coupon, $account, 'commerce_coupon');
}