Q:

Sonata User - Injecting securityContext into Admin class

Maybe dumb question but I used easyExtends to customize SonataUser and I'm trying to inject the security context into the Admin class.
But in my extension there is no service definition and I don't see it neither in vendors.
So the question is quite simple:
How to inject the securityContext in my extended SonataUser Admin's class ?

A:

After weeks of search with no response at all on none of my questions,
I finally found a SonataAdmin service definition example.
Here is what looks like mine:
services:
    sonata.admin.user:
        class: Application\Sonata\UserBundle\Admin\Entity\UserAdmin
        tags:
            - {name: sonata.admin, manager_type: orm, group: user, label: users}
        arguments:
            - null
            - Application\Sonata\UserBundle\Entity\User
            - 'SonataAdminBundle:CRUD'
        calls:
            - [setTranslationDomain, [MyProjectBundle]]
            - [setUserManager, ['@fos_user.user_manager']]
            - [setSecurityContext, ['@security.context']]

Obviously setSecurityContext() have to be implemented into the admin class.

