I want to stop anonymous users being able to access a specific set of routes offered by the core/forum module.
specifically:
forum.index:
path: '/forum'
defaults:
_controller: '\Drupal\forum\Controller\ForumController::forumIndex'
_title: 'Forums'
requirements:
_permission: 'access content'
and
forum.page:
path: '/forum/{taxonomy_term}'
defaults:
_controller: '\Drupal\forum\Controller\ForumController::forumPage'
_title_callback: '\Drupal\taxonomy\Controller\TaxonomyController::termTitle'
requirements:
_permission: 'access content'
I just need to add: _user_is_logged_in: 'TRUE'
to the routes' requirements.
How does one do this without 'hacking' core?
I have alternative routes for the above in my own module - with different names and controllers and in an ideal word I would also wish to redirect both those routes through my own. However, for a start I will take being able to stop anonymous users seeing my forums.