protected function GroupCommentAccessControlHandler::getPermissionInGroups in Open Social 10.0.x
Same name and namespace in other branches
- 8.9 modules/custom/group_core_comments/src/GroupCommentAccessControlHandler.php \Drupal\group_core_comments\GroupCommentAccessControlHandler::getPermissionInGroups()
- 8 modules/custom/group_core_comments/src/GroupCommentAccessControlHandler.php \Drupal\group_core_comments\GroupCommentAccessControlHandler::getPermissionInGroups()
- 8.2 modules/custom/group_core_comments/src/GroupCommentAccessControlHandler.php \Drupal\group_core_comments\GroupCommentAccessControlHandler::getPermissionInGroups()
- 8.3 modules/custom/group_core_comments/src/GroupCommentAccessControlHandler.php \Drupal\group_core_comments\GroupCommentAccessControlHandler::getPermissionInGroups()
- 8.4 modules/custom/group_core_comments/src/GroupCommentAccessControlHandler.php \Drupal\group_core_comments\GroupCommentAccessControlHandler::getPermissionInGroups()
- 8.5 modules/custom/group_core_comments/src/GroupCommentAccessControlHandler.php \Drupal\group_core_comments\GroupCommentAccessControlHandler::getPermissionInGroups()
- 8.6 modules/custom/group_core_comments/src/GroupCommentAccessControlHandler.php \Drupal\group_core_comments\GroupCommentAccessControlHandler::getPermissionInGroups()
- 8.7 modules/custom/group_core_comments/src/GroupCommentAccessControlHandler.php \Drupal\group_core_comments\GroupCommentAccessControlHandler::getPermissionInGroups()
- 8.8 modules/custom/group_core_comments/src/GroupCommentAccessControlHandler.php \Drupal\group_core_comments\GroupCommentAccessControlHandler::getPermissionInGroups()
- 10.3.x modules/custom/group_core_comments/src/GroupCommentAccessControlHandler.php \Drupal\group_core_comments\GroupCommentAccessControlHandler::getPermissionInGroups()
- 10.1.x modules/custom/group_core_comments/src/GroupCommentAccessControlHandler.php \Drupal\group_core_comments\GroupCommentAccessControlHandler::getPermissionInGroups()
- 10.2.x modules/custom/group_core_comments/src/GroupCommentAccessControlHandler.php \Drupal\group_core_comments\GroupCommentAccessControlHandler::getPermissionInGroups()
Checks if account was granted permission in group.
1 call to GroupCommentAccessControlHandler::getPermissionInGroups()
- GroupCommentAccessControlHandler::checkAccess in modules/
custom/ group_core_comments/ src/ GroupCommentAccessControlHandler.php - Performs access checks.
File
- modules/
custom/ group_core_comments/ src/ GroupCommentAccessControlHandler.php, line 73
Class
- GroupCommentAccessControlHandler
- Defines the access control handler for the comment entity type.
Namespace
Drupal\group_core_commentsCode
protected function getPermissionInGroups($perm, AccountInterface $account, $group_contents) {
// Only when you have permission to view the comments.
foreach ($group_contents as $group_content) {
/** @var \Drupal\group\Entity\GroupContent $group_content */
$group = $group_content
->getGroup();
/** @var \Drupal\group\Entity\Group $group */
if ($group
->hasPermission($perm, $account)) {
return AccessResult::allowed()
->cachePerUser();
}
}
// Fallback.
return AccessResult::forbidden()
->cachePerUser();
}