ZnanyLekarz/gatekeeper-bundle — pull request #1 by mlebkowski (2014-09-15 15:33:07+00:00)
Title: `gatekeeper.configuration` and `percent_bucket` access

@lbarulski, @nediam, I present you:

## Default gates configuration

In the following format:

```
gate_keeper:
gates:
sample_gate:
default: allow-all
test_feature:
attributes:
bucket: 0.1
```

`gatekeeper.configuration` class is responsible for returning those values for given gate name. The `Voter` is using it to provide default attributes to `Gatekeeper\Gatekeeper::hasAccess()`

## Percentage Bucket access

Grants access to given percentage of random users and stores this information in their session. This Access uses a funny session key to store information, since the `AccessInterface` doesn’t get the information about the gate it votes on. So users are just tagged as "belongs to the 10-th percentile bucket", etc.

I will change it if you’ll modify the interface.

The current usage is via configuration (if the `DefaultFallbackRepository` is in use):
```
test_feature:
default: percentage-bucket
attributes:
bucket: 0.2
```

Or when invoking the `Voter`:
```php
$securityContext->isGranted('GATE_test_feature', ['bucket' => '1.0']);
```

## Gates descriptions

To be done. This feature introduces gate configuration, so there’s possibility to add description and treat this configuration as a list of all available gates for some kind of GateManager interface.