Update Composer, update everything
This commit is contained in:
parent
ea3e94409f
commit
dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions
33
vendor/chi-teck/drupal-code-generator/templates/d8/service/access-checker.twig
vendored
Normal file
33
vendor/chi-teck/drupal-code-generator/templates/d8/service/access-checker.twig
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\{{ machine_name }}\Access;
|
||||
|
||||
use Drupal\Core\Access\AccessResult;
|
||||
use Drupal\Core\Routing\Access\AccessInterface;
|
||||
use Symfony\Component\Routing\Route;
|
||||
|
||||
/**
|
||||
* Checks if passed parameter matches the route configuration.
|
||||
*
|
||||
* @DCG
|
||||
* To make use of this access checker add '{{ applies_to }}: Some value' entry to route
|
||||
* definition under requirements section.
|
||||
*/
|
||||
class {{ class }} implements AccessInterface {
|
||||
|
||||
/**
|
||||
* Access callback.
|
||||
*
|
||||
* @param \Symfony\Component\Routing\Route $route
|
||||
* The route to check against.
|
||||
* @param \ExampleInterface $parameter
|
||||
* The parameter to test.
|
||||
*
|
||||
* @return \Drupal\Core\Access\AccessResultInterface
|
||||
* The access result.
|
||||
*/
|
||||
public function access(Route $route, \ExampleInterface $parameter) {
|
||||
return AccessResult::allowedIf($parameter->getSomeValue() == $route->getRequirement('{{ applies_to }}'));
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue