function name to be called by another module via drupal_alter? I need to alter data of a contrib module, which does a call drupal_alter('workbench_access_user', $access, $account);.

How must my function look like? My module's name is workbench_access_crud_by_state.

Is the following OK?  What about the parameters? I am confused about that data and context stuff. 

function workbench_access_crud_by_state_workbench_access_user_alter($access, $account) {
  //do sth
  $bla = 'test';
  debug($bla);
}


It seems that my hook implementation is not being called at all and there are no error messages.
A hook implementation is always prefixed by the short name of the module implementing it; alter hooks need to have _alter appended. So, in your case, since workbench_access_crud_by_state is the machine name of the module, workbench_access_crud_by_state_workbench_access_user_alter($access, $account) is the correct signature for that alter-hook implementation.

As for the parameters, drupal_alter() accepts:


$type is the type of the alter hook, without the _alter part; in your case, that is workbench_access_user
&amp;$data is the reference to the variable which contains the value to alter


There are other three parameters, which are optional and normally used to give context to the operation being performed.

In Drupal 8, the call to drupal_alter() is replaced with a call to \Drupal::moduleHandler()-&gt;alter(); in this case, the number of context parameters has been reduced to 2.