entity translation access permission alter I'm using Entity Translation for node translations.

I would like to modify access to edit form for this translation language based on roles and node properties. I've a field in the node entity with a select list of languages, translator should only access translate nodes in languages that are checked in that list.

Which is the best option to modify the access to the node/{NID}/edit/{LANGUAGE} ?


hook_menu_alter ?
hook_node_access(): this hook is called but how can I get the language? ($_GET could be problematic I think).
Extending the EntityTranslation class?
Other?
This is how its working for me, with args() we can get path ie english or any other language node is there :


  Example Paths in my case:
  
  node/[nid]/edit/add/sv/en
  
  node/[nid]/edit/add/en/sv
  
  node/[nid]/edit/sv
  
  node/[nid]/edit/en


define('ROLE_EDITOR',4); // role ID 4
define('ROLE_EDITOR_ENGLISH',10); // role ID 10

function my_module_node_access($node,$op,$account) {
  global $user;

  if (in_array(ROLE_EDITOR, array_keys($user-&gt;roles)) &amp;&amp; !in_array(ROLE_EDITOR_ENGLISH, array_keys($user-&gt;roles))) {
    if(arg(3)== "en"){
      return NODE_ACCESS_DENY;
    }
    if(arg(3) == "add" &amp;&amp; arg(4) == "sv"){
      return NODE_ACCESS_DENY;
    }
  }

  if (!in_array(ROLE_EDITOR, array_keys($user-&gt;roles)) &amp;&amp; in_array(ROLE_EDITOR_ENGLISH, array_keys($user-&gt;roles))) {
    if(arg(3)== "sv" || arg(3)== NULL){  // Null is need to add as edit and edit/sv is same in my case because sv is defult language 
      return NODE_ACCESS_DENY;
    }
    if(arg(3) == "add" &amp;&amp; arg(4) == "en"){
      return NODE_ACCESS_DENY;
    }
  }


}