protected function getEntities($args)
    {
        $dm             = $args->getDocumentManager();
        $resource       = $args->getDocument();
        $repositoryName = $this->getRepositoryName();
        $resourceId     = $resource->getPermissionsResourceId();
        $repository     = $dm->getRepository($repositoryName);
        
        $criteria = array(
            'permissions.assigned.' . $resourceId => array(
                '$exists' => true
            )
        );
        
        $entities = $repository->findBy($criteria);

        return $entities;
    }