Problem/Motivation

tour_example module doesn't demonstrate basic security best practices on its routes.

We need to change that.

In the routes.yml file, it currently says:

  requirements:
    _access: 'TRUE'

This allows anyone with access to the site to see the page, which opens up other possible security concerns.

Proposed resolution

  • Change the routes.yml file to say something like this:
      requirements:
        _permission: 'access content'
    
  • Update the tool menu test to reflect that this route is not visible to anonymous users, and *is* visible once a user with 'access content' permissions has been logged in.
  • Amend any tests which use these routes to log in a user who can access them.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mile23 created an issue. See original summary.

sumthief’s picture

sumthief’s picture

Status: Active » Needs review
Mile23’s picture

Status: Needs review » Needs work
Mile23’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: block_example-access_checking-2585607-2-8.patch, failed testing.

sumthief’s picture

Status: Needs work » Needs review
Mile23’s picture

Status: Needs review » Fixed

The patch applies, the testbot is happy (after some initial hiccups) and so let's commit it!

Thanks, @Shlyapkin!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.