MappedObjectAccessControlHandler.php in Salesforce Suite 8.4
Same filename and directory in other branches
Namespace
Drupal\salesforce_mappingFile
modules/salesforce_mapping/src/MappedObjectAccessControlHandler.phpView source
<?php
namespace Drupal\salesforce_mapping;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Entity\EntityAccessControlHandler;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface;
/**
* Access controller for the comment entity.
*
* @see \Drupal\comment\Entity\Comment.
*/
class MappedObjectAccessControlHandler extends EntityAccessControlHandler {
/**
* {@inheritdoc}
*
* Link the activities to the permissions. checkAccess is called with the
* $operation as defined in the routing.yml file.
*/
protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
return AccessResult::allowedIfHasPermission($account, 'administer salesforce');
}
/**
* {@inheritdoc}
*
* Separate from the checkAccess because the entity does not yet exist, it
* will be created during the 'add' process.
*/
protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
return AccessResult::allowedIfHasPermission($account, 'administer salesforce');
}
}
Classes
Name![]() |
Description |
---|---|
MappedObjectAccessControlHandler | Access controller for the comment entity. |