How to alter commerce order view access? When viewing an order, I want to do checks per order, whether the user may view that order or not.

function my_commerce_entity_info_alter(&amp;$entity_info) {
  $entity_info['commerce_order']['access callback'] = '_my_commerce_commerce_order_access';
}

function _my_commerce_commerce_order_access($op, $entity = NULL, $account = NULL) {
  return $entity-&gt;id == 99; // just for example
}


The above did not work.

I didnt find anything like entity_access_alter or similar.

What do I do wrong?
You should be using hook_commerce_entity_access_condition_ENTITY_TYPE_alter() for commerce orders. 

You receive the following parameters:


$conditions: The OR conditions group used for the view access query.
$context: An array of contextual information including:


account: the account whose access to view the entity is being checked
entity_type: the type of entity in the query 
base_table: the name of the table for the entity type



So it becomes: 

hook_commerce_entity_access_condition_commerce_order_alter(&amp;$conditions, $context) {
  // If we are not allowed to view the order, leave.
  if (!user_access('some_permission', $context['account'])) {
    return;
  }

  $orders = array(99);

  // add a condition
  $conditions-&gt;condition(db_and()
    -&gt;condition($context['base_table'] . '.order_id', $orders, 'IN')
  );
}