AccessResult::andIf

public AccessResult::andIf(AccessResultInterface $other) Combine this access result with another using AND. When AND-ing two access results, the result is: isForbidden() in either ⇒ isForbidden() otherwise, if isAllowed() in both ⇒ isAllowed() otherwise, one of them is isNeutral() ⇒ isNeutral() Truth table: |A N F --+----- A |A N F N |N N F F |F F F Parameters \Drupal\Core\Access\AccessResultInterface $other: The other access result to AND this one with. Return value static Overrides Acc

AccessResult::allowedIfHasPermission

public static AccessResult::allowedIfHasPermission(AccountInterface $account, $permission) Creates an allowed access result if the permission is present, neutral otherwise. Checks the permission and adds a 'user.permissions' cache context. Parameters \Drupal\Core\Session\AccountInterface $account: The account for which to check a permission. string $permission: The permission to check for. Return value \Drupal\Core\Access\AccessResult If the account has the permission, isAllowed() will be TRU

AccessResult::cachePerPermissions

public AccessResult::cachePerPermissions() Convenience method, adds the "user.permissions" cache context. Return value $this File core/lib/Drupal/Core/Access/AccessResult.php, line 239 Class AccessResult Value object for passing an access result with cacheability metadata. Namespace Drupal\Core\Access Code public function cachePerPermissions() { $this->addCacheContexts(array('user.permissions')); return $this; }

AccessResult::allowed

public static AccessResult::allowed() Creates an AccessResultInterface object with isAllowed() === TRUE. Return value \Drupal\Core\Access\AccessResult isAllowed() will be TRUE. File core/lib/Drupal/Core/Access/AccessResult.php, line 47 Class AccessResult Value object for passing an access result with cacheability metadata. Namespace Drupal\Core\Access Code public static function allowed() { return new AccessResultAllowed(); }

AccessResult

Value object for passing an access result with cacheability metadata. The access result itself — excluding the cacheability metadata — is immutable. There are subclasses for each of the three possible access results themselves: When using ::orIf() and ::andIf(), cacheability metadata will be merged accordingly as well. Hierarchy class \Drupal\Core\Access\AccessResult implements AccessResultInterface, RefinableCacheableDependencyInterface uses RefinableCacheableDependencyTrait See also \Drup

AccessManagerInterface::checkRequest

public AccessManagerInterface::checkRequest(Request $request, AccountInterface $account = NULL, $return_as_object = FALSE) Execute access checks against the incoming request. Parameters Request $request: The incoming request. \Drupal\Core\Session\AccountInterface $account: (optional) Run access checks for this account. Defaults to the current user. bool $return_as_object: (optional) Defaults to FALSE. Return value bool|\Drupal\Core\Access\AccessResultInterface The access result. Returns a boo

AccessManager::__construct

public AccessManager::__construct(RouteProviderInterface $route_provider, ParamConverterManagerInterface $paramconverter_manager, AccessArgumentsResolverFactoryInterface $arguments_resolver_factory, AccountInterface $current_user, CheckProviderInterface $check_provider) Constructs a AccessManager instance. Parameters \Drupal\Core\Routing\RouteProviderInterface $route_provider: The route provider. \Drupal\Core\ParamConverter\ParamConverterManagerInterface $paramconverter_manager: The param conv

AccessManagerInterface

Provides an interface for attaching and running access check services. Hierarchy interface \Drupal\Core\Access\AccessManagerInterface File core/lib/Drupal/Core/Access/AccessManagerInterface.php, line 12 Namespace Drupal\Core\Access Members Name Modifiers Type Description AccessManagerInterface::check public function Checks a route against applicable access check services. AccessManagerInterface::checkNamedRoute public function Checks a named route with parameters

AccessManagerInterface::check

public AccessManagerInterface::check(RouteMatchInterface $route_match, AccountInterface $account = NULL, Request $request = NULL, $return_as_object = FALSE) Checks a route against applicable access check services. Determines whether the route is accessible or not. Parameters \Drupal\Core\Routing\RouteMatchInterface $route_match: The route match. \Drupal\Core\Session\AccountInterface $account: (optional) Run access checks for this account. Defaults to the current user. \Symfony\Component\HttpFo

AccessManagerInterface::checkNamedRoute

public AccessManagerInterface::checkNamedRoute($route_name, array $parameters = array(), AccountInterface $account = NULL, $return_as_object = FALSE) Checks a named route with parameters against applicable access check services. Determines whether the route is accessible or not. Parameters string $route_name: The route to check access to. array $parameters: Optional array of values to substitute into the route path pattern. \Drupal\Core\Session\AccountInterface $account: (optional) Run access