Remove delete and save button from node on the basis of permission

Recently i was assigned to do this task.

What i have done:

1. Created a permission for required role.

2. Checked permission for current user.

3. If user does not have the specific permission disable delete and save button. Here is the code to check the permission and disable edit and save button.

function module_name_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  $user = \Drupal::currentUser();
  if(!$user->hasPermission('access language ' . $id)) {
      $form['actions']['delete']['#access'] = FALSE;
      $form['actions']['submit']['#access'] = FALSE;
  }

It will disable submit and delete button for all forms.

Cheers,