public function SocialGroupRequestMembershipNotification::access in Open Social 10.2.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_group/modules/social_group_request/src/Plugin/Block/SocialGroupRequestMembershipNotification.php \Drupal\social_group_request\Plugin\Block\SocialGroupRequestMembershipNotification::access()
- 10.3.x modules/social_features/social_group/modules/social_group_request/src/Plugin/Block/SocialGroupRequestMembershipNotification.php \Drupal\social_group_request\Plugin\Block\SocialGroupRequestMembershipNotification::access()
- 10.0.x modules/social_features/social_group/modules/social_group_request/src/Plugin/Block/SocialGroupRequestMembershipNotification.php \Drupal\social_group_request\Plugin\Block\SocialGroupRequestMembershipNotification::access()
- 10.1.x modules/social_features/social_group/modules/social_group_request/src/Plugin/Block/SocialGroupRequestMembershipNotification.php \Drupal\social_group_request\Plugin\Block\SocialGroupRequestMembershipNotification::access()
Overrides BlockPluginTrait::access
File
- modules/
social_features/ social_group/ modules/ social_group_request/ src/ Plugin/ Block/ SocialGroupRequestMembershipNotification.php, line 176
Class
- SocialGroupRequestMembershipNotification
- Provides a 'Membership requests notification' block.
Namespace
Drupal\social_group_request\Plugin\BlockCode
public function access(AccountInterface $account, $return_as_object = FALSE) {
$is_group_page = isset($this->group);
if ($this->group instanceof Group) {
$is_group_manager = $this->group
->hasPermission('administer members', $account);
return AccessResult::allowedIf($is_group_page && $is_group_manager);
}
return AccessResult::forbidden();
}