You are here

public function AccessEventBase::denyAccess in Organic groups 8

Declare that access is being denied.

Calling this method will cause access to be denied for the action that is being checked. This takes precedence over any other event listeners that might grant access.

Return value

\Drupal\Core\Access\AccessResultInterface The updated access result.

Overrides AccessEventInterface::denyAccess

File

src/Event/AccessEventBase.php, line 68

Class

AccessEventBase
Base class for OG access events.

Namespace

Drupal\og\Event

Code

public function denyAccess() : AccessResultInterface {
  $this->access = $this->access
    ->orIf(AccessResult::forbidden());
  return $this->access;
}