schmittjoh/JMSSecurityExtraBundle — pull request #166 by abstrus (2014-01-06 20:13:18+00:00)
Title: ConfigDriver enhancements

Replaces PR #147 having made a mess in commits. Recent commits in upstream repo have been merged.

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.

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
- Issue #142 and #143
- Issue #140

This pull request hacks around
- Issue #145