Custom access method for a Page Manager page I've created a page using Page Manager, at the route /project/(node}/attendance.
I need to add a custom access check on it, comparing information about the current user with the node to see if they should have access.
I have added a route subscriber, but when I loop through the route collection, my route does not appear. I have read that this is because pages added through the page manager are they themselves nodes.
Is there a way to add a custom access method to a Page Manager route?
So, what I ended up doing is extending the Page Manager PageAccessCheck service:
services:
  custom_route_access.page_access_check:
    class: Drupal\custom_route_access\Entity\PageAccessCheck
    tags:
      - { name: access_check, applies_to: _page_access }

And then:
&lt;?php

namespace Drupal\custom_route_access\Entity;

use Drupal\Core\Access\AccessResult;
use Drupal\Core\Entity\EntityAccessCheck;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Session\AccountInterface;
use Symfony\Component\Routing\Route;

/**
 * We're overriding the page access checks so that we can add our own.
 * Mimics the generic entity access but with a custom key to prevent collisions.
 */
class PageAccessCheck extends EntityAccessCheck {

  /**
   * {@inheritdoc}
   */
  public function access(Route $route, RouteMatchInterface $route_match, AccountInterface $account) {

    // Backup the original requirements.
    $original_requirements = $route-&gt;getRequirements();

    // Replace it with our entity access value and run the parent access check.
    $route-&gt;setRequirement('_entity_access', $route-&gt;getRequirement('_page_access'));
    if($route-&gt;getPath() === '/project/{node}/take_attendance'){
      return self::takeAttendanceAccess($account);
    }
    $access = parent::access($route, $route_match, $account);

    // Restore the original requirements.
    $route-&gt;setRequirements($original_requirements);

    return $access;
  }

  /**
   * Check that user is admin or staff OR has an active team leader registration.
   */
  private static function takeAttendanceAccess($account){

    // ... my custom access check code
  }

}