You are here

public function NodeGrantDatabaseStorage::writeDefault in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/node/src/NodeGrantDatabaseStorage.php \Drupal\node\NodeGrantDatabaseStorage::writeDefault()

Creates the default node access grant entry.

Overrides NodeGrantDatabaseStorageInterface::writeDefault

File

core/modules/node/src/NodeGrantDatabaseStorage.php, line 256

Class

NodeGrantDatabaseStorage
Defines a storage handler class that handles the node grants system.

Namespace

Drupal\node

Code

public function writeDefault() {
  $this->database
    ->insert('node_access')
    ->fields([
    'nid' => 0,
    'realm' => 'all',
    'gid' => 0,
    'grant_view' => 1,
    'grant_update' => 0,
    'grant_delete' => 0,
  ])
    ->execute();
}