You are here

protected function PrivateMessageAccessControlHandler::checkCreateAccess in Private Message 8

Same name and namespace in other branches
  1. 8.2 src/Entity/Access/PrivateMessageAccessControlHandler.php \Drupal\private_message\Entity\Access\PrivateMessageAccessControlHandler::checkCreateAccess()

Separate from the checkAccess because the entity does not yet exist, it will be created during the 'add' process.

Overrides EntityAccessControlHandler::checkCreateAccess

File

src/Entity/Access/PrivateMessageAccessControlHandler.php, line 102

Class

PrivateMessageAccessControlHandler
Access control handler for private message entities.

Namespace

Drupal\private_message\Entity\Access

Code

protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
  return AccessResult::allowedIfHasPermission($account, 'use private messaging system');
}