interface RefinableCalculatedPermissionsInterface

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Session/RefinableCalculatedPermissionsInterface.php \Drupal\Core\Session\RefinableCalculatedPermissionsInterface

Defines the refinable calculated permissions interface.

Hierarchy

Expanded class hierarchy of RefinableCalculatedPermissionsInterface

All classes that implement RefinableCalculatedPermissionsInterface

2 files declare their use of RefinableCalculatedPermissionsInterface
AccessPolicyProcessorTest.php in core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php
InstallerAccessPolicy.php in core/lib/Drupal/Core/Installer/InstallerAccessPolicy.php

File

core/lib/Drupal/Core/Session/RefinableCalculatedPermissionsInterface.php, line 10

Namespace

Drupal\Core\Session
View source
interface RefinableCalculatedPermissionsInterface extends RefinableCacheableDependencyInterface, CalculatedPermissionsInterface {
    
    /**
     * Adds a calculated permission item.
     *
     * @param \Drupal\Core\Session\CalculatedPermissionsItemInterface $item
     *   The calculated permission item.
     * @param bool $overwrite
     *   (optional) Whether to overwrite an item if there already is one for the
     *   given identifier within the scope. Defaults to FALSE, meaning a merge
     *   will take place instead.
     *
     * @return self
     */
    public function addItem(CalculatedPermissionsItemInterface $item, bool $overwrite = FALSE) : self;
    
    /**
     * Removes a single calculated permission item from a given scope.
     *
     * @param string $scope
     *   (optional) The scope name to remove the item from, defaults to 'drupal'.
     * @param string|int $identifier
     *   (optional) The scope identifier to remove the item from, defaults to
     *   'drupal'.
     *
     * @return self
     */
    public function removeItem(string $scope = AccessPolicyInterface::SCOPE_DRUPAL, string|int $identifier = AccessPolicyInterface::SCOPE_DRUPAL) : self;
    
    /**
     * Removes all of the calculated permission items, regardless of scope.
     *
     * @return $this
     */
    public function removeItems() : self;
    
    /**
     * Removes all of the calculated permission items for the given scope.
     *
     * @param string $scope
     *   The scope name to remove the items for.
     *
     * @return self
     */
    public function removeItemsByScope(string $scope) : self;
    
    /**
     * Merge another calculated permissions object into this one.
     *
     * This merges (not replaces) all permissions and cacheable metadata.
     *
     * @param \Drupal\Core\Session\CalculatedPermissionsInterface $other
     *   The other calculated permissions object to merge into this one.
     *
     * @return self
     */
    public function merge(CalculatedPermissionsInterface $other) : self;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
CacheableDependencyInterface::getCacheContexts public function The cache contexts associated with this object. 34
CacheableDependencyInterface::getCacheMaxAge public function The maximum age for which this object may be cached. 34
CacheableDependencyInterface::getCacheTags public function The cache tags associated with this object. 27
CalculatedPermissionsInterface::getItem public function Retrieves a single calculated permission item from a given scope.
CalculatedPermissionsInterface::getItems public function Retrieves all of the calculated permission items, regardless of scope.
CalculatedPermissionsInterface::getItemsByScope public function Retrieves all of the calculated permission items for the given scope.
CalculatedPermissionsInterface::getScopes public function Retrieves all of the scopes that have items for them.
RefinableCacheableDependencyInterface::addCacheableDependency public function Adds a dependency on an object: merges its cacheability metadata. 1
RefinableCacheableDependencyInterface::addCacheContexts public function Adds cache contexts. 1
RefinableCacheableDependencyInterface::addCacheTags public function Adds cache tags. 1
RefinableCacheableDependencyInterface::mergeCacheMaxAge public function Merges the maximum age (in seconds) with the existing maximum age. 1
RefinableCalculatedPermissionsInterface::addItem public function Adds a calculated permission item. 1
RefinableCalculatedPermissionsInterface::merge public function Merge another calculated permissions object into this one. 1
RefinableCalculatedPermissionsInterface::removeItem public function Removes a single calculated permission item from a given scope. 1
RefinableCalculatedPermissionsInterface::removeItems public function Removes all of the calculated permission items, regardless of scope. 1
RefinableCalculatedPermissionsInterface::removeItemsByScope public function Removes all of the calculated permission items for the given scope. 1

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