You are here

public function SocialGroupInviteNotificationBlock::access in Open Social 10.2.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_group/modules/social_group_invite/src/Plugin/Block/SocialGroupInviteNotificationBlock.php \Drupal\social_group_invite\Plugin\Block\SocialGroupInviteNotificationBlock::access()
  2. 10.3.x modules/social_features/social_group/modules/social_group_invite/src/Plugin/Block/SocialGroupInviteNotificationBlock.php \Drupal\social_group_invite\Plugin\Block\SocialGroupInviteNotificationBlock::access()
  3. 10.0.x modules/social_features/social_group/modules/social_group_invite/src/Plugin/Block/SocialGroupInviteNotificationBlock.php \Drupal\social_group_invite\Plugin\Block\SocialGroupInviteNotificationBlock::access()
  4. 10.1.x modules/social_features/social_group/modules/social_group_invite/src/Plugin/Block/SocialGroupInviteNotificationBlock.php \Drupal\social_group_invite\Plugin\Block\SocialGroupInviteNotificationBlock::access()

Overrides BlockPluginTrait::access

File

modules/social_features/social_group/modules/social_group_invite/src/Plugin/Block/SocialGroupInviteNotificationBlock.php, line 135

Class

SocialGroupInviteNotificationBlock
Provides a 'Invite notification' block.

Namespace

Drupal\social_group_invite\Plugin\Block

Code

public function access(AccountInterface $account, $return_as_object = FALSE) {
  $is_group_page = isset($this->group);
  $is_logged_in = $account
    ->isAuthenticated();
  return AccessResult::allowedIf($is_group_page && $is_logged_in);
}