This bundle provides commands under the security namespace (security:debug:*) to help debugging your application
security in a simple way, by inspecting Voters, Listeners and (yet to come) ACL.
This bundle fakes credentials and tokens to be able to inspect permissions. This implies a possible security hole in your application, please be aware of this. I'm not responsible for any issue derived for a misuse or an insecure use of it
The DataCollector feature re issues the request and some events to be able to inspect the results. If any of your custom voters, listeners, firewal listeners has side effects they will be issued twice
As for any command you should use: app/console from your project root.
Current available commands are:
- app/console security:debug:firewallsto view listeners for a firewall.
- app/console security:debug:votersto display voters, voters vote and result.
- app/console security:debug:acl_votersto display voters, voters vote and result when ACL is present.
- app/console security:debug:acl_objectto display ACL results for each mask provided.
- 
app/console security:debug:firewalls uri firewall username roles
- 
uriThe exact URI you have in the firewall
- 
firewallFirewall name
- 
usernameUser to test
- 
rolesMultiple space separated roles for the user
- 
app/console security:debug:voters(this can be faked too, but for the moment a real user is needed)
- 
firewallSecured area of the app
- 
usernameUsername to authenticate
- 
passwordUsername Password
- 
app/console security:debug:acl_voters username object-fqcn id permission-name
- 
usernameFor which user you need the information
- 
object-fqcnThe object class for which you are asking (using/instead of\)
- 
idObject ID in the DB
- 
permission-nameThe permission map name, e.g. OWNER
- 
app/console security:debug:acl_object username object-fqcn mask-binary
- 
usernameFor which user you need the information
- 
object-fqcnThe object class for which you are asking (using/instead of\)
- 
idObject ID in the DB
- 
mask-binaryThe binary of the mask, e.g. 128 (OWNER)
- app/console security:debug:firewallshere
- app/console security:debug:votershere
- app/console security:debug:acl_votershere
- app/console security:debug:acl_objecthere
Add to your composer.json
{
    "require": {
        "egulias/security-debug-command-bundle": "0.5.0"
    }
}
Use composer to download the new requirement
$ php composer.phar update egulias/security-debug-command-bundle
<?php
  // app/AppKernel.php
  public function registerBundles()
  {
    // ...
    if (in_array($this->getEnvironment(), array('dev', 'test'))) { 
      $bundle[] = Egulias\SecurityDebugCommandBundle\EguliasSecurityDebugCommandBundle();
    }
    // ...
  }In your app/config/config.yml you should add the FQCN that you use:
egulias_security_debug_command:
    user_class: Acme\DemoBundle\Entity\User