Pull merge.
[yaffs-website] / web / core / modules / views / src / Plugin / views / access / None.php
1 <?php
2
3 namespace Drupal\views\Plugin\views\access;
4
5 use Drupal\Core\Session\AccountInterface;
6 use Symfony\Component\Routing\Route;
7
8 /**
9  * Access plugin that provides no access control at all.
10  *
11  * @ingroup views_access_plugins
12  *
13  * @ViewsAccess(
14  *   id = "none",
15  *   title = @Translation("None"),
16  *   help = @Translation("Will be available to all users.")
17  * )
18  */
19 class None extends AccessPluginBase {
20
21   /**
22    * {@inheritdoc}
23    */
24   public function summaryTitle() {
25     return $this->t('Unrestricted');
26   }
27
28   /**
29    * {@inheritdoc}
30    */
31   public function access(AccountInterface $account) {
32     // No access control.
33     return TRUE;
34   }
35
36   /**
37    * {@inheritdoc}
38    */
39   public function alterRouteDefinition(Route $route) {
40     $route->setRequirement('_access', 'TRUE');
41   }
42
43 }