Skip to content

Comments

ConfigDriver enhancements#166

Open
cblegare wants to merge 36 commits intoschmittjoh:masterfrom
cblegare:PR-configdriver
Open

ConfigDriver enhancements#166
cblegare wants to merge 36 commits intoschmittjoh:masterfrom
cblegare:PR-configdriver

Conversation

@cblegare
Copy link
Contributor

@cblegare cblegare commented Jan 6, 2014

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

This pull request hacks around

cblegare and others added 30 commits September 23, 2013 11:45
…alization for XML config and removed value setting for Symfony comformity in DI-configuration vaidation
See conversation in #123 for more details.
…alization for XML config and removed value setting for Symfony comformity in DI-configuration vaidation
@stof
Copy link
Contributor

stof commented Jan 9, 2014

looks like you messed your rebase: you merge your rebased branch with your older branch instead of forcing the push

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants