PHPackages                             appsco/assertion-voter-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. appsco/assertion-voter-bundle

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

appsco/assertion-voter-bundle
=============================

Assertion Voter Bundle

1.0.1(11y ago)01101PHPPHP &gt;=5.4

Since May 6Pushed 11y ago3 watchersCompare

[ Source](https://github.com/Appsco/AssertionVoterBundle)[ Packagist](https://packagist.org/packages/appsco/assertion-voter-bundle)[ RSS](/packages/appsco-assertion-voter-bundle/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Assertion Voter Bundle
======================

[](#assertion-voter-bundle)

Usage
-----

[](#usage)

### Register bundle in kernel

[](#register-bundle-in-kernel)

```
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Appsco\AssertionVoterBundle\AppscoAssertionVoterBundle(),
        );

        // ...
    }
}

```

### Configure

[](#configure)

```
# app/config/config.yml

appsco_assertion_voter:
    voter_record_provider: appsco.assertion.voter_record_provider.orm # Default Doctrine ORM voter record provider
    voter_factory: appsco.assertion.voter_factory.simple

```

### Use

[](#use)

```
// Controller

public function fooAction()
{
    // Fetch assertion information from your service
    $info = $this->get('your_info_provider')->getInfo();

    // Resolve roles
    $roles = $this->get('appsco.assertion.role_resolver')->resolve($info);
}

```

Persistence layer integration
-----------------------------

[](#persistence-layer-integration)

Bundle can be integrated with any persistence layer by implementing your own `VoterRecordProviderInterface` or by using one already provided in the bundle.

### Doctrine Orm Voter Record Provider

[](#doctrine-orm-voter-record-provider)

1. (required) Create your VoterRecord entity

    In most cases it will look like this:

    ```
