Change record status: 
Project: 
Introduced in branch: 
8.x
Introduced in version: 
8.0
Description: 

In Drupal 7, there are two methods to translate nodes: the built in content translation module and the built in multilingual fields API (that has its UI in contrib in the entity_translation module). The node access system works well with the first system since it uses separate nodes for different languages. The later system does not use separate nodes, and the node access system did not take language into account, so you cannot have separate permissions per language. This is changed in Drupal 8. The runtime node access checks via node_access() now support providing language level permissions to a specific node.

When invoking node_access(), there is now an optional language code argument:

Drupal 7 examples:

$access = node_access('view', $node);
$access = node_access('create', 'article', $account);

Drupal 8 can also specify a language code optionally:

$access = node_access('view', $node, NULL, $langcode);
$access = node_access('create', 'article', $account, $langcode);

Using the API this way, the system retrieves node access specific to the language and node (and optionally account) specified.

To support this, hook_node_access() was also extended with a $langcode argument, therefore its new signature is:

hook_node_access($node, $op, $account, $langcode)

Node revisions access checking got language support later in #1667614: Make node revision access language aware. The stored node access system got language support much later, see http://drupal.org/node/1959668 for documentation on that.

Impacts: 
Module developers