Mercurial > hg > isophonics-drupal-site
comparison core/lib/Drupal/Core/Access/AccessManagerInterface.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 7a779792577d |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\Core\Access; | |
4 | |
5 use Symfony\Component\HttpFoundation\Request; | |
6 use Drupal\Core\Session\AccountInterface; | |
7 use Drupal\Core\Routing\RouteMatchInterface; | |
8 | |
9 /** | |
10 * Provides an interface for attaching and running access check services. | |
11 */ | |
12 interface AccessManagerInterface { | |
13 | |
14 /** | |
15 * Checks a named route with parameters against applicable access check services. | |
16 * | |
17 * Determines whether the route is accessible or not. | |
18 * | |
19 * @param string $route_name | |
20 * The route to check access to. | |
21 * @param array $parameters | |
22 * Optional array of values to substitute into the route path pattern. | |
23 * @param \Drupal\Core\Session\AccountInterface $account | |
24 * (optional) Run access checks for this account. Defaults to the current | |
25 * user. | |
26 * @param bool $return_as_object | |
27 * (optional) Defaults to FALSE. | |
28 * | |
29 * @return bool|\Drupal\Core\Access\AccessResultInterface | |
30 * The access result. Returns a boolean if $return_as_object is FALSE (this | |
31 * is the default) and otherwise an AccessResultInterface object. | |
32 * When a boolean is returned, the result of AccessInterface::isAllowed() is | |
33 * returned, i.e. TRUE means access is explicitly allowed, FALSE means | |
34 * access is either explicitly forbidden or "no opinion". | |
35 */ | |
36 public function checkNamedRoute($route_name, array $parameters = [], AccountInterface $account = NULL, $return_as_object = FALSE); | |
37 | |
38 /** | |
39 * Execute access checks against the incoming request. | |
40 * | |
41 * @param Request $request | |
42 * The incoming request. | |
43 * @param \Drupal\Core\Session\AccountInterface $account | |
44 * (optional) Run access checks for this account. Defaults to the current | |
45 * user. | |
46 * @param bool $return_as_object | |
47 * (optional) Defaults to FALSE. | |
48 * | |
49 * @return bool|\Drupal\Core\Access\AccessResultInterface | |
50 * The access result. Returns a boolean if $return_as_object is FALSE (this | |
51 * is the default) and otherwise an AccessResultInterface object. | |
52 * When a boolean is returned, the result of AccessInterface::isAllowed() is | |
53 * returned, i.e. TRUE means access is explicitly allowed, FALSE means | |
54 * access is either explicitly forbidden or "no opinion". | |
55 */ | |
56 public function checkRequest(Request $request, AccountInterface $account = NULL, $return_as_object = FALSE); | |
57 | |
58 /** | |
59 * Checks a route against applicable access check services. | |
60 * | |
61 * Determines whether the route is accessible or not. | |
62 * | |
63 * @param \Drupal\Core\Routing\RouteMatchInterface $route_match | |
64 * The route match. | |
65 * @param \Drupal\Core\Session\AccountInterface $account | |
66 * (optional) Run access checks for this account. Defaults to the current | |
67 * user. | |
68 * @param \Symfony\Component\HttpFoundation\Request $request | |
69 * Optional, a request. Only supply this parameter when checking the | |
70 * incoming request, do not specify when checking routes on output. | |
71 * @param bool $return_as_object | |
72 * (optional) Defaults to FALSE. | |
73 * | |
74 * @return bool|\Drupal\Core\Access\AccessResultInterface | |
75 * The access result. Returns a boolean if $return_as_object is FALSE (this | |
76 * is the default) and otherwise an AccessResultInterface object. | |
77 * When a boolean is returned, the result of AccessInterface::isAllowed() is | |
78 * returned, i.e. TRUE means access is explicitly allowed, FALSE means | |
79 * access is either explicitly forbidden or "no opinion". | |
80 */ | |
81 public function check(RouteMatchInterface $route_match, AccountInterface $account = NULL, Request $request = NULL, $return_as_object = FALSE); | |
82 | |
83 } |