class AccessResultAllowed

Same name in other branches
  1. 9 core/lib/Drupal/Core/Access/AccessResultAllowed.php \Drupal\Core\Access\AccessResultAllowed
  2. 10 core/lib/Drupal/Core/Access/AccessResultAllowed.php \Drupal\Core\Access\AccessResultAllowed
  3. 11.x core/lib/Drupal/Core/Access/AccessResultAllowed.php \Drupal\Core\Access\AccessResultAllowed

Value object indicating an allowed access result, with cacheability metadata.

Hierarchy

Expanded class hierarchy of AccessResultAllowed

4 files declare their use of AccessResultAllowed
BlockPluginHasSettingsTrayFormAccessCheckTest.php in core/modules/settings_tray/tests/src/Unit/Access/BlockPluginHasSettingsTrayFormAccessCheckTest.php
LatestRevisionCheckTest.php in core/modules/content_moderation/tests/src/Unit/LatestRevisionCheckTest.php
MigrateAccessCheck.php in core/modules/migrate_drupal_ui/src/MigrateAccessCheck.php
PathBasedBreadcrumbBuilderTest.php in core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php
Contains \Drupal\Tests\system\Unit\Breadcrumbs\PathBasedBreadcrumbBuilderTest.
2 string references to 'AccessResultAllowed'
RendererTest::testRenderWithAccessControllerResolved in core/tests/Drupal/Tests/Core/Render/RendererTest.php
@covers ::render @covers ::doRender
TestAccessClass::trustedCallbacks in core/tests/Drupal/Tests/Core/Render/RendererTest.php
Lists the trusted callbacks provided by the implementing class.

File

core/lib/Drupal/Core/Access/AccessResultAllowed.php, line 8

Namespace

Drupal\Core\Access
View source
class AccessResultAllowed extends AccessResult {
    
    /**
     * {@inheritdoc}
     */
    public function isAllowed() {
        return TRUE;
    }

}

Members

Title Sort descending Deprecated Modifiers Object type Summary Overriden Title Overrides
AccessResult::allowed public static function Creates an AccessResultInterface object with isAllowed() === TRUE.
AccessResult::allowedIf public static function Creates an allowed or neutral access result.
AccessResult::allowedIfHasPermission public static function Creates an allowed access result if the permission is present, neutral otherwise.
AccessResult::allowedIfHasPermissions public static function Creates an allowed access result if the permissions are present, neutral otherwise.
AccessResult::andIf public function Combine this access result with another using AND. Overrides AccessResultInterface::andIf
AccessResult::cachePerPermissions public function Convenience method, adds the "user.permissions" cache context.
AccessResult::cachePerUser public function Convenience method, adds the "user" cache context.
AccessResult::cacheUntilConfigurationChanges Deprecated public function Convenience method, adds the configuration object's cache tag.
AccessResult::cacheUntilEntityChanges Deprecated public function Convenience method, adds the entity's cache tag.
AccessResult::forbidden public static function Creates an AccessResultInterface object with isForbidden() === TRUE.
AccessResult::forbiddenIf public static function Creates a forbidden or neutral access result.
AccessResult::getCacheContexts public function The cache contexts associated with this object. Overrides CacheableDependencyTrait::getCacheContexts
AccessResult::getCacheMaxAge public function The maximum age for which this object may be cached. Overrides CacheableDependencyTrait::getCacheMaxAge
AccessResult::getCacheTags public function The cache tags associated with this object. Overrides CacheableDependencyTrait::getCacheTags
AccessResult::inheritCacheability public function Inherits the cacheability of the other access result, if any.
AccessResult::isForbidden public function Overrides AccessResultInterface::isForbidden 1
AccessResult::isNeutral public function Overrides AccessResultInterface::isNeutral 1
AccessResult::neutral public static function Creates an AccessResultInterface object with isNeutral() === TRUE.
AccessResult::orIf public function Combine this access result with another using OR. Overrides AccessResultInterface::orIf
AccessResult::resetCacheContexts public function Resets cache contexts (to the empty array).
AccessResult::resetCacheTags public function Resets cache tags (to the empty array).
AccessResult::setCacheMaxAge public function Sets the maximum age for which this access result may be cached.
AccessResultAllowed::isAllowed public function Checks whether this access result indicates access is explicitly allowed. Overrides AccessResult::isAllowed
CacheableDependencyTrait::$cacheContexts protected property Cache contexts.
CacheableDependencyTrait::$cacheMaxAge protected property Cache max-age.
CacheableDependencyTrait::$cacheTags protected property Cache tags.
CacheableDependencyTrait::setCacheability protected function Sets cacheability; useful for value object constructors.
RefinableCacheableDependencyTrait::addCacheableDependency public function 1
RefinableCacheableDependencyTrait::addCacheContexts public function
RefinableCacheableDependencyTrait::addCacheTags public function
RefinableCacheableDependencyTrait::mergeCacheMaxAge public function

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.