Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Strategy #40

Closed
migo315 opened this issue Sep 28, 2018 · 1 comment
Closed

Strategy #40

migo315 opened this issue Sep 28, 2018 · 1 comment
Assignees
Milestone

Comments

@migo315
Copy link
Contributor

migo315 commented Sep 28, 2018

Normally, the individual fields in the config.yml are an OR condition. In this example, the feature is enabled if the environment variable returns true or if the logged in user contains the ROLE_ADMIN role.

# config.yml

flagception:
    features:      
        feature_123:
            env: FOOBAR
            roles: ROLE_ADMIN

It would be interesting to be able to modify the strategy so that it becomes an AND condition. If you change the strategy and use the same example, the feature would only be enabled if the environment variable returns true AND the user contains the ROLE_ADMIN role.

# config.yml

flagception:
    features:      
        feature_123:
            env: FOOBAR
            roles: ROLE_ADMIN

        feature_345:
            env: FOOBAR
            roles: ROLE_ADMIN
            strategy: single # Overwrite the global strategy for this feature)
    
     # Set global for all (Default: single)            
     config:
         strategy: all

all => All defined conditions must match for activating this feature
single => at least one condition must match for activating this feature

@migo315 migo315 added this to the 3.2 milestone Sep 28, 2018
@migo315 migo315 self-assigned this Sep 28, 2018
@migo315
Copy link
Contributor Author

migo315 commented May 6, 2019

I like the strategy idea but I think we have to decouple all activators instead of merging.

@migo315 migo315 closed this as completed May 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant