You are here

function hook_uc_addresses_may_view in Ubercart Addresses 7

Same name and namespace in other branches
  1. 6.2 uc_addresses.api.php \hook_uc_addresses_may_view()

This hook allows you to prevent a certain address from being viewed.

Don't use this hook if you want to prevent viewing addresses for users with a certain role. You can use the permission settings for that.

If you want the address not to be viewed return FALSE. Return TRUE in all other cases. WARNING: If you don't return TRUE, then no address may be viewed.

Note that this hook is only invoked when permissions are checked and not when the address itself is displayed (e.g., through theme ('uc_addresses_list_address')).

Parameters

object $address_user: The owner of the address.

UcAddressesAddress $address: (optional) Address object.

object $account: The account to check access for.

Return value

boolean FALSE if the account may not view the address or any address from the address user if no address is passed. TRUE otherwise.

1 invocation of hook_uc_addresses_may_view()
UcAddressesPermissions::canViewAddress in class/UcAddressesPermissions.class.php
Check if user may view this address.

File

./uc_addresses.api.php, line 323
These hooks are invoked by the Ubercart Addresses module. @todo more documentation needed for hook_uc_addresses_field_handlers(). @todo Document the rest of the API.

Code

function hook_uc_addresses_may_view($address_user, $address, $account) {

  // No specific restrictions for viewing addresses.
  return TRUE;
}