You are here

protected function SocialAlbumCountAndAddBlock::blockAccess in Open Social 10.3.x

Same name and namespace in other branches
  1. 10.0.x modules/social_features/social_album/src/Plugin/Block/SocialAlbumCountAndAddBlock.php \Drupal\social_album\Plugin\Block\SocialAlbumCountAndAddBlock::blockAccess()
  2. 10.1.x modules/social_features/social_album/src/Plugin/Block/SocialAlbumCountAndAddBlock.php \Drupal\social_album\Plugin\Block\SocialAlbumCountAndAddBlock::blockAccess()
  3. 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

self::access()

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\Block

Code

protected function blockAccess(AccountInterface $account) {
  return AccessResult::allowedIf($this
    ->getProperties() !== NULL);
}