You are here

protected function SocialEventInviteLocalActionsBlock::blockAccess in Open Social 8.9

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_event/modules/social_event_invite/src/Plugin/Block/SocialEventInviteLocalActionsBlock.php \Drupal\social_event_invite\Plugin\Block\SocialEventInviteLocalActionsBlock::blockAccess()
  2. 10.0.x modules/social_features/social_event/modules/social_event_invite/src/Plugin/Block/SocialEventInviteLocalActionsBlock.php \Drupal\social_event_invite\Plugin\Block\SocialEventInviteLocalActionsBlock::blockAccess()
  3. 10.1.x modules/social_features/social_event/modules/social_event_invite/src/Plugin/Block/SocialEventInviteLocalActionsBlock.php \Drupal\social_event_invite\Plugin\Block\SocialEventInviteLocalActionsBlock::blockAccess()
  4. 10.2.x modules/social_features/social_event/modules/social_event_invite/src/Plugin/Block/SocialEventInviteLocalActionsBlock.php \Drupal\social_event_invite\Plugin\Block\SocialEventInviteLocalActionsBlock::blockAccess()

Indicates whether the block should be shown.

Blocks with specific access checking should override this method rather than access(), in order to avoid repeating the handling of the $return_as_object argument.

Parameters

\Drupal\Core\Session\AccountInterface $account: The user session for which to check access.

Return value

\Drupal\Core\Access\AccessResult The access result.

Overrides BlockPluginTrait::blockAccess

See also

self::access()

File

modules/social_features/social_event/modules/social_event_invite/src/Plugin/Block/SocialEventInviteLocalActionsBlock.php, line 80

Class

SocialEventInviteLocalActionsBlock
Provides a 'SocialEventInviteLocalActionsBlock' block.

Namespace

Drupal\social_event_invite\Plugin\Block

Code

protected function blockAccess(AccountInterface $account) {
  try {
    return $this->accessHelper
      ->eventFeatureAccess();
  } catch (InvalidPluginDefinitionException $e) {
    return AccessResult::neutral();
  } catch (PluginNotFoundException $e) {
    return AccessResult::neutral();
  }
}