Advanced route access checking

Custom access checking on routes

Sometimes just relying on permissions and/or roles is not sufficient and you need to do custom access checking on routes. To achieve this, implement a class and use that to check access. If your module is called example, this would be a simple implementation placed under example/src/Access/CustomAccessCheck.php:

Users, permissions, and roles

Every visitor to your site, whether they have an account and log in or visit the site anonymously, is considered a user to Drupal. Every user also has a numeric user ID special to the type of user.

If a user is not logged in, then the user is considered an Anonymous user having user ID 0. Otherwise, the Drupal site visitor has a user id greater than 0. User ID 1 is reserved for the Administrator. This is also called the master Administrator.

Add a display to a view

You can add one or more displays to a view. Each display is a variation of the view. For example, you could start with a view that shows a page of recently modified content and then create new displays to output the same content as a block and as a feed. A display can also be modified to override any of the view parameters.

Subscribe with RSS Subscribe to RSS - Access