protected function SocialAlbumCountAndAddBlock::blockAccess in Open Social 10.3.x
Same name and namespace in other branches
- 10.0.x modules/social_features/social_album/src/Plugin/Block/SocialAlbumCountAndAddBlock.php \Drupal\social_album\Plugin\Block\SocialAlbumCountAndAddBlock::blockAccess()
- 10.1.x modules/social_features/social_album/src/Plugin/Block/SocialAlbumCountAndAddBlock.php \Drupal\social_album\Plugin\Block\SocialAlbumCountAndAddBlock::blockAccess()
- 10.2.x modules/social_features/social_album/src/Plugin/Block/SocialAlbumCountAndAddBlock.php \Drupal\social_album\Plugin\Block\SocialAlbumCountAndAddBlock::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_album/ src/ Plugin/ Block/ SocialAlbumCountAndAddBlock.php, line 120
Class
- SocialAlbumCountAndAddBlock
- Provides a block to display images count and a button for adding new images.
Namespace
Drupal\social_album\Plugin\BlockCode
protected function blockAccess(AccountInterface $account) {
return AccessResult::allowedIf($this
->getProperties() !== NULL);
}