public function SocialGroupInviteNotificationBlock::access in Open Social 10.0.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_group/modules/social_group_invite/src/Plugin/Block/SocialGroupInviteNotificationBlock.php \Drupal\social_group_invite\Plugin\Block\SocialGroupInviteNotificationBlock::access()
- 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()
- 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()
- 10.2.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\BlockCode
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);
}