title: EzPublish users : how to use ezPublish access control in front standard symfony controller
body: <p>I'm using ezPublish 5.3 only for its administration side. What I want to do is to manage users / user groups / roles in this back-office and control their access to a FOSRestBundle designed API.</p>
  
  <p>Here is my security.yml :</p>
  
  <pre><code>security:
      providers:
          ezpublish:
              id: ezpublish.security.user_provider
  
      firewalls:
          dev:
              pattern: ^/(_(profiler|wdt)|css|images|js)/
              security: false
  
          my_api:
              pattern: ^/api/v[0-9]+
              stateless: true
              ezpublish_http_basic:
                  realm: eZ Publish REST API
  
          ezpublish_front:
              pattern: ^/
              anonymous: ~
              ezpublish_rest_session: ~
              form_login:
                  require_previous_session: false
              logout: ~
  
          default:
              anonymous: ~
  </code></pre>
  
  <p>And here is what I want to do in my controller :</p>
  
  <pre><code>&lt;?php
  namespace Acme\AppBundle\Controller;
  
  use FOS\RestBundle\Controller\FOSRestController;
  
  class ItemsController extends FOSRestController
  {
      public function postItemsAction(Request $request)
      {
          if (!$this-&gt;get('security.authorization_checker')-&gt;isGranted('EZ_CUSTOM_ROLE')) {
              throw new \Exception('No Auth');
          }
  
          //... do something
       }
  }
  </code></pre>
  
  <p>I got this response :</p>
  
  <pre><code>{
    "code": 0,
    "message": "User 'USER_LOGIN' doesn't have user/login permission to SiteAccess 'site'"
  }
  </code></pre>
  
  <p>How can I achieve that ?
  How can I retrieve the user role ?</p>
  
  <p>In the profiler I can see that when I do a standard POST with basic auth to this action, the user is connected with the default Symfony role <code>ROLE_USER</code>.</p>