protected function GroupStatisticBlock::blockAccess in Open Social 8.8
Same name and namespace in other branches
- 8.9 modules/social_features/social_group/src/Plugin/Block/GroupStatisticBlock.php \Drupal\social_group\Plugin\Block\GroupStatisticBlock::blockAccess()
- 10.3.x modules/social_features/social_group/src/Plugin/Block/GroupStatisticBlock.php \Drupal\social_group\Plugin\Block\GroupStatisticBlock::blockAccess()
- 10.0.x modules/social_features/social_group/src/Plugin/Block/GroupStatisticBlock.php \Drupal\social_group\Plugin\Block\GroupStatisticBlock::blockAccess()
- 10.1.x modules/social_features/social_group/src/Plugin/Block/GroupStatisticBlock.php \Drupal\social_group\Plugin\Block\GroupStatisticBlock::blockAccess()
- 10.2.x modules/social_features/social_group/src/Plugin/Block/GroupStatisticBlock.php \Drupal\social_group\Plugin\Block\GroupStatisticBlock::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
File
- modules/
social_features/ social_group/ src/ Plugin/ Block/ GroupStatisticBlock.php, line 100
Class
- GroupStatisticBlock
- Provides a 'GroupStatisticBlock' block.
Namespace
Drupal\social_group\Plugin\BlockCode
protected function blockAccess(AccountInterface $account) {
// Show statistic block only when new style is enabled.
if (theme_get_setting('style') === 'sky') {
return AccessResult::allowed();
}
return AccessResult::forbidden();
}