/**
  * {@inheritdoc}
  */
 public function get(RequestConfiguration $requestConfiguration, RepositoryInterface $repository)
 {
     if ($requestConfiguration->hasPermission() && $this->requireOwnerCheck($vars = $requestConfiguration->getVars())) {
         $owner = $this->currentIdentityProvider->getIdentity();
         $ownerField = is_bool($vars['acl_owner']) ? ResourceOwnerFilter::FIELD : $vars['acl_owner'];
         // using in grid param
         $requestConfiguration->getRequest()->query->set(ResourceOwnerFilter::TYPE, $owner);
         $criteria = $requestConfiguration->getCriteria();
         $criteria[$ownerField] = $owner;
         $requestConfiguration->getParameters()->set('criteria', $criteria);
     }
     return $this->decoratedResolver->get($requestConfiguration, $repository);
 }
 /**
  * {@inheritdoc}
  */
 public function isGranted($permissionCode)
 {
     $identity = $this->currentIdentityProvider->getIdentity();
     if (null === $identity) {
         $identity = new \Sylius\Component\Rbac\Model\AnonymousIdentity();
     }
     if (!$identity instanceof IdentityInterface) {
         throw new \InvalidArgumentException('Current identity must implement "Sylius\\Component\\Rbac\\Model\\IdentityInterface".');
     }
     $roles = $this->rolesResolver->getRoles($identity);
     foreach ($roles as $role) {
         if ($this->permissionMap->hasPermission($role, $permissionCode)) {
             return true;
         }
     }
     return false;
 }