How do I add a class to the form element of the search block form?

I mean, add a class to this element:

```
<form action="/search/node" method="get" id="search-block-form" accept-charset="UTF-8" data-drupal-form-fields="edit-keys"></form>

```

I've tried:

```
function mytheme_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'search_block_form') {
    $form['#attributes'] = array('class' => array('abc'));
  }
}

```

and

```
function mytheme_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'search_block_form') {
    $form['#attributes']['class'][] = 'abc';
  }
}

```

I've tried:

```
function mytheme_preprocess_form(&$variables) {
  if ($variables['element']['#form_id'] == 'search_block_form') {
    $variables['element']['#attributes'] = array('class' => array('xyz'));
  }
}

```

I've looked into altering `core/modules/system/templates/form.html.twig`, which does not look like the way to go.

I'm using the Bootstrap theme as my base.
['https://drupal.stackexchange.com/questions/247136', 'https://drupal.stackexchange.com', 'https://drupal.stackexchange.com/users/14968/']
Just tested this and `$node->access('update');` works for me. I let the optional $account parameter out so that it would check the currently logged in user.

The only difference was that I loaded my node with:

```
\Drupal\node\Entity\Node::load($nid);

```

To just use `Node::load($nid);` Make sure to include:

```
use Drupal\node\Entity\Node;

```

at the top of your file.
As Rubix05 mentions, the issue is that you are testing "edit" access when you should be testing "update" access.

```
$node = Node::load(1);
$account = User::load(1);
$check = $node->access('update', $account);

```