You are here

class GroupContentEntityOperationAccessEvent in Organic groups 8

Event that determines access to group content entity operations.

Hierarchy

Expanded class hierarchy of GroupContentEntityOperationAccessEvent

1 file declares its use of GroupContentEntityOperationAccessEvent
OgAccess.php in src/OgAccess.php

File

src/Event/GroupContentEntityOperationAccessEvent.php, line 13

Namespace

Drupal\og\Event
View source
class GroupContentEntityOperationAccessEvent extends AccessEventBase implements GroupContentEntityOperationAccessEventInterface {

  /**
   * The entity operation being performed.
   *
   * @var string
   */
  protected $operation;

  /**
   * The group content entity upon which the operation is being performed.
   *
   * @var \Drupal\Core\Entity\ContentEntityInterface
   */
  protected $groupContent;

  /**
   * Constructs a GroupContentEntityOperationAccessEvent.
   *
   * @param string $operation
   *   The entity operation, such as "create", "update" or "delete".
   * @param \Drupal\Core\Entity\ContentEntityInterface $group
   *   The group in scope of which the access check is being performed.
   * @param \Drupal\Core\Entity\ContentEntityInterface $groupContent
   *   The group content upon which the entity operation is performed.
   * @param \Drupal\Core\Session\AccountInterface $user
   *   The user for which to check access.
   */
  public function __construct(string $operation, ContentEntityInterface $group, ContentEntityInterface $groupContent, AccountInterface $user) {
    parent::__construct($group, $user);
    $this->operation = $operation;
    $this->groupContent = $groupContent;
  }

  /**
   * {@inheritdoc}
   */
  public function getOperation() : string {
    return $this->operation;
  }

  /**
   * {@inheritdoc}
   */
  public function getGroupContent() : ContentEntityInterface {
    return $this->groupContent;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AccessEventBase::$access protected property The access result.
AccessEventBase::$group protected property The group that provides the context for the access check.
AccessEventBase::$user protected property The user for which to check access.
AccessEventBase::denyAccess public function Declare that access is being denied. Overrides AccessEventInterface::denyAccess
AccessEventBase::getAccessResult public function Returns the current access result object. Overrides AccessEventInterface::getAccessResult
AccessEventBase::getGroup public function Returns the group that provides the context for the access check. Overrides AccessEventInterface::getGroup
AccessEventBase::getUser public function Returns the user for which access is being determined. Overrides AccessEventInterface::getUser
AccessEventBase::grantAccess public function Declare that access is being granted. Overrides AccessEventInterface::grantAccess
AccessEventBase::mergeAccessResult public function Merges the given access result with the existing access result. Overrides AccessEventInterface::mergeAccessResult
CacheableDependencyTrait::$cacheContexts protected property Cache contexts.
CacheableDependencyTrait::$cacheMaxAge protected property Cache max-age.
CacheableDependencyTrait::$cacheTags protected property Cache tags.
CacheableDependencyTrait::getCacheContexts public function 3
CacheableDependencyTrait::getCacheMaxAge public function 3
CacheableDependencyTrait::getCacheTags public function 3
CacheableDependencyTrait::setCacheability protected function Sets cacheability; useful for value object constructors.
GroupContentEntityOperationAccessEvent::$groupContent protected property The group content entity upon which the operation is being performed.
GroupContentEntityOperationAccessEvent::$operation protected property The entity operation being performed.
GroupContentEntityOperationAccessEvent::getGroupContent public function Returns the group content entity upon which the operation is performed. Overrides GroupContentEntityOperationAccessEventInterface::getGroupContent
GroupContentEntityOperationAccessEvent::getOperation public function Returns the entity operation being performed. Overrides GroupContentEntityOperationAccessEventInterface::getOperation
GroupContentEntityOperationAccessEvent::__construct public function Constructs a GroupContentEntityOperationAccessEvent. Overrides AccessEventBase::__construct
GroupContentEntityOperationAccessEventInterface::EVENT_NAME constant The event name.
RefinableCacheableDependencyTrait::addCacheableDependency public function 1
RefinableCacheableDependencyTrait::addCacheContexts public function
RefinableCacheableDependencyTrait::addCacheTags public function
RefinableCacheableDependencyTrait::mergeCacheMaxAge public function