Here I am on a project for my studies and I use symfony fosUser and sonata, I have a Book entity that I administer with sonata. 

The problem is that I want to give an user to a book, but it becomes complicated when I want to find in my field user only the user whose role ROLE\_MyRole, I search on forums for several hours without finding. 

I'm sorry for my incompetence I learn symfony recently and does not yet have enough experience.

This is my BookAdmin

```

class BookAdmin extends Admin
{
    // Fields to be shown on create/edit forms
    protected function configureFormFields(FormMapper $formMapper)
    {
        static $options = array();
        $currentBook = $this->getSubject();
        if (null !== $currentBook->getFileName())
            $options = array(
                'required' => false,
                'help' => 'getWebPath().'">Download File : '.$currentBook->getFileName().'',
            );

        $formMapper
            ->add('title', null, array('label' => 'Titre : '))
            ->add('summary', null, array('label' => 'Résumé : '))
            ->add('category', null, array('label' => 'Catégorie : '))
            ->add('readers', null, array('label' => 'Lecteur(s) : '))
            ->add('file', 'file', $options)
            ;
    }

```

And this is my Book entity with readers field

```

class Book
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @var string
     *
     * @ORM\Column(name="title", type="string", length=255)
     */
    protected $title;

    /**
     * @var string
     *
     * @ORM\Column(name="summary", type="text")
     */
    protected $summary;

    /**
     * @Assert\File(
     *      mimeTypes={"application/pdf", "application/x-pdf"},
     *      mimeTypesMessage="Only PDF"
     * )
     */
    protected $file;

    /**
     * @var string
     *
     * @ORM\Column(name="file_path", type="string", length=255)
     */
    protected $fileName;

    /**
     * @var \DateTime
     *
     * @Gedmo\Timestampable(on="create")
     * @ORM\Column(name="created_at", type="datetime")
     */
    protected $createdAt;

    /**
     * @var \DateTime
     *
     * @Gedmo\Timestampable(on="update")
     * @ORM\Column(name="updated_at", type="datetime")
     */
    protected $updatedAt;

    /**
     * @var bool
     *
     * @ORM\Column(name="enabled", type="boolean", nullable=true)
     */
    protected $enabled;

    /**
     * @var bool
     *
     * @ORM\Column(name="received_by_reader", type="boolean", nullable=true)
     */
    protected $receivedByReader;

    /**
     * @var bool
     *
     * @ORM\Column(name="download_by_reader", type="boolean", nullable=true)
     */
    protected $downloadByReader;

    /**
     * @var bool
     *
     * @ORM\Column(name="send_by_reader", type="boolean", nullable=true)
     */
    protected $sendByReader;

    /**
     * @var bool
     *
     * @ORM\Column(name="reader_validation", type="boolean", nullable=true)
     */
    protected $readerValidation;

    /**
     * @var bool
     *
     * @ORM\Column(name="edited", type="boolean", nullable=true)
     */
    protected $edited;

    /**
     * @var User
     *
     * @ORM\ManyToOne(targetEntity="Application\Sonata\UserBundle\Entity\User")
     */
    protected $author;

    /**
     * @var ArrayCollection
     *
     * @ORM\ManyToMany(targetEntity="Application\Sonata\UserBundle\Entity\User", cascade={"persist"})
     */
    protected $readers;

```

Thanks You