protected function PostAccessControlHandler::checkDefaultAccess in Open Social 8
Same name and namespace in other branches
- 8.9 modules/social_features/social_post/src/PostAccessControlHandler.php \Drupal\social_post\PostAccessControlHandler::checkDefaultAccess()
- 8.2 modules/social_features/social_post/src/PostAccessControlHandler.php \Drupal\social_post\PostAccessControlHandler::checkDefaultAccess()
- 8.3 modules/social_features/social_post/src/PostAccessControlHandler.php \Drupal\social_post\PostAccessControlHandler::checkDefaultAccess()
- 8.4 modules/social_features/social_post/src/PostAccessControlHandler.php \Drupal\social_post\PostAccessControlHandler::checkDefaultAccess()
- 8.5 modules/social_features/social_post/src/PostAccessControlHandler.php \Drupal\social_post\PostAccessControlHandler::checkDefaultAccess()
- 8.6 modules/social_features/social_post/src/PostAccessControlHandler.php \Drupal\social_post\PostAccessControlHandler::checkDefaultAccess()
- 8.7 modules/social_features/social_post/src/PostAccessControlHandler.php \Drupal\social_post\PostAccessControlHandler::checkDefaultAccess()
- 8.8 modules/social_features/social_post/src/PostAccessControlHandler.php \Drupal\social_post\PostAccessControlHandler::checkDefaultAccess()
- 10.3.x modules/social_features/social_post/src/PostAccessControlHandler.php \Drupal\social_post\PostAccessControlHandler::checkDefaultAccess()
- 10.0.x modules/social_features/social_post/src/PostAccessControlHandler.php \Drupal\social_post\PostAccessControlHandler::checkDefaultAccess()
- 10.1.x modules/social_features/social_post/src/PostAccessControlHandler.php \Drupal\social_post\PostAccessControlHandler::checkDefaultAccess()
- 10.2.x modules/social_features/social_post/src/PostAccessControlHandler.php \Drupal\social_post\PostAccessControlHandler::checkDefaultAccess()
1 call to PostAccessControlHandler::checkDefaultAccess()
- PostAccessControlHandler::checkAccess in modules/
social_features/ social_post/ src/ PostAccessControlHandler.php - Performs access checks.
File
- modules/
social_features/ social_post/ src/ PostAccessControlHandler.php, line 110
Class
- PostAccessControlHandler
- Access controller for the Post entity.
Namespace
Drupal\social_postCode
protected function checkDefaultAccess(EntityInterface $entity, $operation, AccountInterface $account) {
switch ($operation) {
case 'view':
if (!$entity
->isPublished()) {
return AccessResult::allowedIfHasPermission($account, 'view unpublished post entities');
}
return AccessResult::allowedIfHasPermission($account, 'view published post entities');
case 'update':
return AccessResult::allowedIfHasPermission($account, 'edit any post entities');
case 'delete':
return AccessResult::allowedIfHasPermission($account, 'delete any post entities');
}
// Unknown operation, no opinion.
return AccessResult::neutral();
}