You are here

function hook_commerce_file_download_unlicensed_access_alter in Commerce File 7

Alter the access rules applied to an unlicensed Commerce file download.

Parameters

$grants: An array of grants gathered by hook_commerce_file_download_unlicensed_access(). The array is keyed by the module that defines the access control; the values are Boolean grant responses for each module.

$file: A file object.

$account: A user object attempting to download the file.

$licenses: An array of licenses associated with the user that currently do not allow access to the file.

File

./commerce_file.api.php, line 246
Hooks provided by the Commerce File module.

Code

function hook_commerce_file_download_unlicensed_access_alter(&$grants, $file, $account = NULL, $licenses = array()) {

  // override another module's grants
  if (isset($grants['another_module'])) {
    $grants['another_module'] = FALSE;
  }
}