- Issue created by @mr.baileys
Drupal automatically uses the current user if none is explicitly provided. So we can simplify the code by removing the
$user
variable and updating the access check like this$check = $entity->access('update');
as mentioned in the MR.
I have tested the patch as well and it's worked fine, moving this to RTBC.