public function putToNodeAccess(AccountInterface $account, RouteMatch $route_match) {
    // We'd have 404'd already if node didn't exist, so no need to check.
    // Just hack it out of the route match.
    $node = $route_match->getParameter('node');
    return AccessResult::allowedIf($node->access('update', $account) && $account->hasPermission('create media'));
  }
public function putToNodeAccess(AccountInterface $account, RouteMatch $route_match) {
    // We'd have 404'd already if node didn't exist, so no need to check.
    // Just hack it out of the route match.
    $node = $route_match->getParameter('node');
    return AccessResult::allowedIf($node->access('update', $account) && $account->hasPermission('create media'));
  }
public function putToNodeAccess ( AccountInterface $ account , RouteMatch $ route_match ) { // We'd have 404'd already if node didn't exist, so no need to check. // Just hack it out of the route match. $ node = $ route_match -> getParameter ( 'node' ) ; return AccessResult :: allowedIf ( $ node -> access ( 'update' , $ account ) && $ account -> hasPermission ( 'create media' ) ) ; }
Checks for permissions to update a node and create media.

@param \Drupal\Core\Session\AccountInterface $account
Account for user making the request.
@param \Drupal\Core\Routing\RouteMatch $route_match
Route match to get Node from url params.

@return \Drupal\Core\Access\AccessResultInterface
Access result.
Checks for permissions to update a node and create media .