function NodeAccessRebuild::needsRebuild

Same name and namespace in other branches
  1. 11.x core/modules/node/src/NodeAccessRebuild.php \Drupal\node\NodeAccessRebuild::needsRebuild()

Reads the value of a flag for rebuilding the node access grants.

When the flag is set, a message is displayed to users with 'access administration pages' permission, pointing to the 'rebuild' confirm form. This can be used as an alternative to direct rebuild calls, allowing administrators to decide when they want to perform the actual (possibly time consuming) rebuild.

When unsure if the current user is an administrator, self::rebuild() should be used instead.

Return value

bool The current value of the flag.

See also

self::rebuild()

File

core/modules/node/src/NodeAccessRebuild.php, line 49

Class

NodeAccessRebuild
Provides methods for checking and rebuilding node access permissions.

Namespace

Drupal\node

Code

public function needsRebuild() : bool {
  return $this->state
    ->get(self::STATE_KEY, FALSE);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.