How to hide Forums from anonymous users? I installed Forum module.
So, I have 'Forums' link in 'Tools' menu corresponding to the path /forum defined in forum.routing.yml in which access is defined by _permission: 'access content'.
In my site, anonymous users are allowed to "View published content", so they can see the 'Forum' link.
I don't want anonymous users to be able to see forums and, therefore, the forum topics.
I thought to override the _permission of forum.routing.yml but I don't know how to do that?
How can I do that?  

Or is there another solution?
You can change the permission associated with a route doing what Altering existing routes and adding new routes based on dynamic ones / Altering existing routes says to do.


Create a service that is tagged with name: event_subscriber
The class implementing the service extends RouteSubscriberBase
The service class defines its alterRoutes() method that in RouteSubscriberBase is an abstract method


In your case, the alterRoutes() method would be similar to the following one.

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {
    if ($route = $collection-&gt;get('forum.index')) {
      $route-&gt;setRequirement('_permission', 'access forum pages');
    }
    if ($route = $collection-&gt;get('forum.page')) {
      $route-&gt;setRequirement('_permission', 'access forum pages');
    }
  }


Instead of access forum pages, you can use a different permission, including an existing one that you think it suits more.