Change record status: 
Project: 
Introduced in branch: 
11.4.x
Introduced in version: 
11.4.0
Description: 

The '#access' key in render array elements must now be either an AccessResultInterface object or FALSE. The use any other type or value is deprecated.

Before

Any #access value that is not strictly FALSE or an AccessResultInterface object is set to TRUE.

$element = [
  '#markup' => 'foo',
  '#access' => new \stdClass(),
];

Results in a deprecation message.

After

Modules should make sure that they use a valid value in #access. For example,

$element = [
  '#markup' => 'foo',
  '#access' => \Drupal\Core\Access\AccessResultInterface::isAllowed,
];
Impacts: 
Module developers