schmittjoh/JMSSecurityExtraBundle — pull request #147 by abstrus (2013-09-23 18:04:50+00:00)
Title: Adding support for a wider variety of security enforcement using DI-configuration

Instead of defaulting DI-configuration of method access control to equivalent of *`PreAuthorize`* annotation, this pull request provides support for more specific method access control policies.

DI configuration entries can now use the following configuration keys
- `pre_authorize`
- `secure`
- `secure_param`
- `secure_return`
- `run_as`

and use them in the same way they are used with annotations.

Any valid configuration syntax is supported.

Here is an example of valid YAML DI configuration
```
jms_security_extra:
# ...
method_access_control:

# retro-compatible with good'ol DI configuration
'UserManager::delete$': 'hasRole("FOO")'
'TestBundle:Crud:add': 'hasRole("FOO")'
'TestBundle:Foo:exception': 'permitAll'
'TestBundle:Foo:.*': 'hasRole("MOO")'

# key may be anything.
# It is not used if 'pattern' is set
AdvancedConfig:
pattern: 'TestBundle:Crud:delete$'
pre_authorize: 'hasRole("FOO")'
-
pattern: 'TestBundle:*'
secure_return:
roles:
- ROLE_SUPERADMIN
'SecretSecureService::secure*' # Name stands as 'pattern' if needed
run_as: 'ROLE_NINJA'
```

This pull request fully solves
- [x] Issue #142 and #143
- [x] Issue #140

This pull request hacks around
- [x] Issue #145