public function PmAddBlock::blockAccess in Open Social 10.1.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_private_message/src/Plugin/Block/PmAddBlock.php \Drupal\social_private_message\Plugin\Block\PmAddBlock::blockAccess()
- 8 modules/social_features/social_private_message/src/Plugin/Block/PmAddBlock.php \Drupal\social_private_message\Plugin\Block\PmAddBlock::blockAccess()
- 8.2 modules/social_features/social_private_message/src/Plugin/Block/PmAddBlock.php \Drupal\social_private_message\Plugin\Block\PmAddBlock::blockAccess()
- 8.3 modules/social_features/social_private_message/src/Plugin/Block/PmAddBlock.php \Drupal\social_private_message\Plugin\Block\PmAddBlock::blockAccess()
- 8.4 modules/social_features/social_private_message/src/Plugin/Block/PmAddBlock.php \Drupal\social_private_message\Plugin\Block\PmAddBlock::blockAccess()
- 8.5 modules/social_features/social_private_message/src/Plugin/Block/PmAddBlock.php \Drupal\social_private_message\Plugin\Block\PmAddBlock::blockAccess()
- 8.6 modules/social_features/social_private_message/src/Plugin/Block/PmAddBlock.php \Drupal\social_private_message\Plugin\Block\PmAddBlock::blockAccess()
- 8.7 modules/social_features/social_private_message/src/Plugin/Block/PmAddBlock.php \Drupal\social_private_message\Plugin\Block\PmAddBlock::blockAccess()
- 8.8 modules/social_features/social_private_message/src/Plugin/Block/PmAddBlock.php \Drupal\social_private_message\Plugin\Block\PmAddBlock::blockAccess()
- 10.3.x modules/social_features/social_private_message/src/Plugin/Block/PmAddBlock.php \Drupal\social_private_message\Plugin\Block\PmAddBlock::blockAccess()
- 10.0.x modules/social_features/social_private_message/src/Plugin/Block/PmAddBlock.php \Drupal\social_private_message\Plugin\Block\PmAddBlock::blockAccess()
- 10.2.x modules/social_features/social_private_message/src/Plugin/Block/PmAddBlock.php \Drupal\social_private_message\Plugin\Block\PmAddBlock::blockAccess()
Custom access logic to display the block.
Overrides BlockPluginTrait::blockAccess
File
- modules/
social_features/ social_private_message/ src/ Plugin/ Block/ PmAddBlock.php, line 26
Class
- PmAddBlock
- Provides a 'PmAddBlock' block.
Namespace
Drupal\social_private_message\Plugin\BlockCode
public function blockAccess(AccountInterface $account) {
if ($account
->hasPermission('use private messaging system') && $account
->hasPermission('create private messages thread')) {
return AccessResult::allowed();
}
return AccessResult::forbidden();
}