AccessResult::allowedIfHasPermissions

public static AccessResult::allowedIfHasPermissions(AccountInterface $account, array $permissions, $conjunction = 'AND') Creates an allowed access result if the permissions are present, neutral otherwise. Checks the permission and adds a 'user.permissions' cache contexts. Parameters \Drupal\Core\Session\AccountInterface $account: The account for which to check permissions. array $permissions: The permissions to check. string $conjunction: (optional) 'AND' if all permissions are required, 'OR'

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::allowedIf

public static AccessResult::allowedIf($condition) Creates an allowed or neutral access result. Parameters bool $condition: The condition to evaluate. Return value \Drupal\Core\Access\AccessResult If $condition is TRUE, isAllowed() will be TRUE, otherwise isNeutral() will be TRUE. File core/lib/Drupal/Core/Access/AccessResult.php, line 76 Class AccessResult Value object for passing an access result with cacheability metadata. Namespace Drupal\Core\Access Code public static function al

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

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

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

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

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